Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : $DATE_LENGTH

$DATE_LENGTH
Returns the maximum string length of a given date format. (F)
Invocation
length = $DATE_LENGTH(pic_string)
 
The given date format. Its syntax is C (fixed-length character string), UN (Unicode), or V (variable-length character string).
Usage Notes
The valid display masks are listed here:
One‑ or two‑digit week # (of year), with no leading 0.
Two‑digit week # (of year).
Two‑character quarter.
Two‑digit century.
/ \ ; : , . * - blank
A week is defined to begin on a Monday and end on the following Sunday. However, January 1st always begins week one, regardless of where it falls in the week, and week two starts on the following Monday.
You can specify just a portion of a date field within your mask (for example, entering only MMMM displays the month). Partial date occurrences cannot be accessed using a GET or FORALL statement, as the data cannot be interpreted as a complete date. At least the year portion of a date must be present in the mask to make it accessible to these statements.

Exceptions
 
Signalled if pic_string is not a valid date format.
Example
The following rule returns the maximum length of the date format, which is given as an argument, and displays the result on the message line of the workbench:

 
DATE_LENGTH;
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ CALL ENDMSG('THE LENGTH OF THE DATE FORMAT IS ' || | 1
_ $DATE_LENGTH('MMMM,D,YYYY')); |
_ ---------------------------------------------------------------------------

 
It returns:  THE LENGTH OF THE DATE FORMAT IS 17
Basis for the Value Returned
This length is based on the following:
These values total up to 17.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved