Convert Lilian Date to Character Format (CEEDATE) API


  Required Parameter Group:

1 input_Lilian_date Input INT4
2 picture_string Input VSTRING
3 output_char_date Output VSTRING

  Omissible Parameter:

4 fc Output FEEDBACK

  Service Program Name: QLEAWI

  Default Public Authority: *USE

  Threadsafe: Yes

The Convert Lilian Date to Character Format (CEEDATE) API formats a number representing a Lilian date. The output is a character string such as 1988/07/26.

Authorities and Locks

None.


Required Parameter Group

input_Lilian_date (input)
A 32-bit binary integer representing the Lilian date, which is the number of days since 14 October 1582. For example, 16 May 1988 is day number 148 138. Valid range is 1 to 3 074 324 (31 December 9999).

picture_string (input by descriptor)
A character string representing the desired format of output_char_date, for example MM/DD/YY. Each character in picture_string represents a character in output_char_date. If delimiters such as the slash (/) appear in the picture string, they are copied as is to output_char_date.

Picture Characters Used in Picture Strings has a list of valid picture characters, and Examples of Picture Strings Recognized by ILE Date and Time APIs contains examples of valid picture strings.

If picture_string is null or blank, CEEDATE obtains picture_string based on the current job value for the country or region ID (CNTRYID). For example, if the current job value for CNTRYID is US (United States), the date format is MM/DD/YYYY. If the current job value for CNTRYID is FR (France), the date format is DD.MM.YYYY.

This default mechanism makes it easy for translators to specify the preferred date format, and also easy for application programs and library procedures to automatically use this format.

output_char_date (output by descriptor)
A character string that is the result of converting input_Lilian_date to the format specified by picture_string. If necessary, output will be truncated to the length of output_char_date. Sample Output of the CEEDATE API contains sample output dates. If input_Lilian_date is not valid, output_char_date is set to all blanks and CEEDATE ends with a nonzero feedback-code.

Omissible Parameter

fc (output)
A 12-byte feedback code passed by reference. If specified as an argument, feedback information (a condition token) is returned to the calling procedure. If not specified and the requested operation was not successfully completed, the condition is signaled to the condition manager.

Feedback Codes and Conditions

CEE0000 The API completed successfully
Severity: 00  
CEE0501 The operational descriptor data type is not valid
Severity: 30  
CEE0502 Missing operational descriptor
Severity: 30  
CEE2512 The value for the given Lilian date is not valid
Severity: 30  
CEE2518 The picture string specification is not valid
Severity: 30  
CEE2522 Lilian date outside of era
Severity: 30  
CEE2526 Date truncated
Severity: 30  
CEE9902 Unexpected user error occurred in &1
Severity: 30  

Usage Notes


Sample Output of the CEEDATE API

input_Lilian_date picture_string output_char_date
148138
YY
YYMM
YY-MM
YYMMDD
YYYYMMDD
YYYY-MM-DD
YYYY-ZM-ZD
<JJJJ> YY.MM.DD
<CCCC> YY.MM.DD

88
8805
88-05
880516
19880516
1988-05-16
1988-5-16
Showa 63.05.16 (in a DBCS string)
MinKow 77.05.16 (in a DBCS string)
148139
MM
MMDD
MM/DD
MMDDYY
MM/DD/YYYY
ZM/DD/YYYY

05
0517
05/17
051788
05/17/1988
5/17/1988
148140
DD
DDMM
DDMMYY
DD.MM.YY
DD.MM.YYYY
DD Mmm YYYY

18
1805
180588
18.05.88
18.05.1988
18 May 1988
148141
DDD
YYDDD
YY.DDD
YYYY.DDD

140
88140
88.140
1988.140
148142
YY/MM/DD HH:MI:SS.99
YYYY/ZM/ZD ZH:MI AP

88/05/20 00:00:00.00
88/5/20 0:00 AM
148143
WWW., MMM DD, YYYY
Www., Mmm DD, YYYY
Wwwwwwwwww, Mmmmmmmmmm DD, YYYY
Wwwwwwwwwz, Mmmmmmmmmz DD, YYYY
SAT., MAY 21, 1988
Sat., May 21, 1988
Saturday  , May        21,  1988
Saturday, May 21, 1988

Example

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.



API introduced: V2R3

[ Back to top | ILE CEE APIs | APIs by category ]