Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Picture character terms and strings

You use picture strings (templates that indicate the format of the input data or the desired format of the output data) for several of the date and time callable services.

Table 77. Picture character terms and strings
Picture terms Explanations Valid values Notes
Y
YY
YYY
ZYY
YYYY
One-digit year
Two-digit year
Three-digit year
Three-digit year within era
Four-digit year
0-9
00-99
000-999
1-999
1582-9999
Y valid for output only.
YY assumes range set by CEESCEN.
YYY/ZYY used with <JJJJ>, <CCCC>, and <CCCCCCCC>.
<JJJJ> Japanese Era name in Kanji characters with UTF-16 hexadecimal encoding Heisei (NX'5E736210')
Showa (NX'662D548C')
Taisho (NX'59276B63')
Meiji (NX'660E6CBB')
Affects YY field: if <JJJJ> is specified, YY means the year within Japanese Era. For example, 1988 equals Showa 63.
MM
ZM
Two-digit month
One- or two-digit month
01-12
1-12
 
For output, leading zero suppressed. For input, ZM treated as MM.
RRRR
RRRZ
Roman numeral month Ibbb-XIIb (left justified) For input, source string is folded to uppercase. For output, uppercase only. I=Jan, II=Feb, ..., XII=Dec.
MMM
Mmm
MMMM...M
Mmmm...m
MMMMMMMMMZ
Mmmmmmmmmz
Three-char month, uppercase
Three-char month, mixed case
Three-20 char mo., uppercase
Three-20 char mo., mixed case
Trailing blanks suppressed
Trailing blanks suppressed
JAN-DEC
Jan-Dec
JANUARYbb-DECEMBERb
Januarybb-Decemberb
JANUARY-DECEMBER
January-December
For input, source string always folded to uppercase. For output, M generates uppercase and m generates lowercase. Output is padded with blanks (b) (unless Z specified) or truncated to match the number of Ms, up to 20.
DD
ZD
DDD
Two-digit day of month
One- or two-digit day of mo.
Day of year (Julian day)
01-31
1-31
001-366
For output, leading zero is always suppressed. For input, ZD treated as DD.
HH
ZH
Two-digit hour
One- or two-digit hour
00-23
0-23
For output, leading zero suppressed. For input, ZH treated as HH. If AP specified, valid values are 01-12.
MI Minute 00-59  
SS Second 00-59  
9
99
999
Tenths of a second
Hundredths of a second
Thousandths of a second
0-9
00-99
000-999
No rounding
AP
ap
A.P.
a.p.
AM/PM indicator AM or PM
am or pm
A.M. or P.M.
a.m. or p.m.
AP affects HH/ZH field. For input, source string always folded to uppercase. For output, AP generates uppercase and ap generates lowercase.
W
WWW
Www
WWW...W
Www...w
WWWWWWWWWZ
Wwwwwwwwwz
One-char day-of-week
Three-char day, uppercase
Three-char day, mixed case
Three-20 char day, uppercase
Three-20 char day, mixed case
Trailing blanks suppressed
Trailing blanks suppressed
S, M, T, W, T, F, S
SUN-SAT
Sun-Sat
SUNDAYbbb-SATURDAYb
Sundaybbb-Saturdayb
SUNDAY-SATURDAY
Sunday-Saturday
For input, Ws are ignored. For output, W generates uppercase and w generates lowercase. Output padded with blanks (unless Z specified) or truncated to match the number of Ws, up to 20.
All others Delimiters X'01'-X'FF'
(X'00' is reserved for “internal” use by the date and time callable services)
For input, treated as delimiters between the month, day, year, hour, minute, second, and fraction of a second. For output, copied exactly as is to the target string.
Note: Blank characters are indicated by the symbol b.

The following table defines Japanese Eras used by date and time services when <JJJJ> is specified.

Table 78. Japanese Eras
First date of Japanese Era Era name Era name in Kanji with UTF-16 hexadecimal encoding Valid year values
1868-09-08 Meiji NX'660E6CBB' 01-45
1912-07-30 Taisho NX'59276B63' 01-15
1926-12-25 Showa NX'662D548C' 01-64
1989-01-08 Heisei NX'5E736210' 01-999 (01 = 1989)

Example: date-and-time picture strings


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)