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


Chapter 3 Tools : $DATE_PIC

$DATE_PIC
Converts a value of semantic type date to a semantic type string. (F)
Invocation
date_string = $DATE_PIC(pic_string, date)
 
Contains the resulting string. Its syntax is V (variable-length character string).\
The format of the resulting string. Its syntax is C (fixed-length character string), UN (Unicode), or V.
Usage Notes
If pic_string is null the installation default is used.
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 1 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 string, or if date is not a date.
Signalled if pic_string contains invalid characters, or if it is not in a valid date format.
Example
The following rule:
1.
2.

 
INSERT_BIRTHDATE;
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ FORALL EMPLOYEE_DATE : | 1
_ GET EMPLOYEE WHERE EMPNO = EMPLOYEE_DATE.EMPNO; |
_ EMPLOYEE.BIRTHDATE = $DATE_PIC('YY/MM/DD', |
_ EMPLOYEE_DATE.BIRTHDATE); |
_ REPLACE EMPLOYEE; |
_ COMMIT; |
_ END; |
_ ---------------------------------------------------------------------------

 
The format of the BIRTHDATE field in the table EMPLOYEE_DATE is illustrated here. It appears in the default date format for the installation.

 
EMPNO .... BIRTHDATE
------ ----------
80000 1960-06-13
80002 1972-09-11
80003 1962-12-30
80004 1964-04-22
80014 1970-09-21

 
It is converted to the format illustrated below, in the EMPLOYEE table:

 
EMPNO .... BIRTHDATE
------ ----------
80000 60/06/13
80002 72/09/11
80003 62/12/30
80004 64/04/22
80014 70/09/21

 

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