Re: Compute Date Duration

Simon Coulter <shc-Q/[email protected]>
Newsgroups gmane.comp.lang.as400.mi
Message-ID <[email protected]>
On 17/10/2005, at 11:03 PM, Njål Fisketjøn wrote:

> Do you think that you need the end element if you specify 0 for the 
> number or elements?

I think specifying zero for the number of Era or Calendar elements is 
only valid when the DDAT is used to describe a value for which Era and 
Calendar make no sense. Refer to the table in the MI Reference 
describing operand type and DDAT field associations. Era and Calendar 
are not valid for:
	Time
	Pseudo Time
	Date Duration
	Time Duration
	Timestamp Duration
	Year Label Duration
	Month Label Duration
	Day Label Duration
	Hour Label Duration
	Minute Label Duration
	Second Label Duration
	Microsecond Label Duration

DDATs that describe these operand types need only be 100 bytes in 
length. The manual does not say the Era table and Calendar tables are 
optional--just not valid and must be zeroed. While it might be possible 
that a DDAT without zero-filled Era and Calendar tables may work I 
suspect the intention is that they should be present.

So to answer your specific question: If 0 is specified for the number 
of Calendar table entries then the end table is not required (because 
the first entry is effectively an end entry). However a DDAT that 
describes a Date type or a Timestamp type must have a Calendar table. 
If using the SAA Calendar then two entries are required. For other 
Calendars (Julian, Muslim, or Hebrew) I am not certain how many entries 
are required and the documentation is less than helpful.

Regards,
Simon Coulter.
--------------------------------------------------------------------
    FlyByNight Software         AS/400 Technical Specialists

    http://www.flybynight.com.au/
    Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
    Fax:   +61 3 9419 0175                                   \ /
                                                              X
                  ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



_______________________________________________
This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mi400
or email: MI400-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mi400.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.