now, it will be easy to output the date, as the specification indicate that the date need to be at MMM DD, YYYY.
the code would probably like this using STRING
STRING
TABLE-MONTH(WS-MONTH) DELIMITED BY SIZE,
' ' DELIMITED BY SIZE,
WS-DAY-ALPHA DELIMITED SIZE,
', 20' DELIMITED BY SIZE,
WS-YEAR DELIMITED BY SIZE
INTO DTL-DATE
END-STRING.
displaying the output will give me
AUG 25, 2006
that's correct, but here's the problem...
for example the date is Aug. 5, 2006 or Aug. 20, 2006...
i need to display it like: AUG 5, 2006 AUG 20, 2006
notice that there are only 1 space between the 'AUG' and '5'.
i cant correctly find a way to remove the spaces between them, i always
end up having an output of AUG 5, 2006 (with two spaces).
i tried truncating the zero, but when i encounter days with zero, the program also removes them like the one above, i displayed it like
AUG 2 , 2006
now, can anyone please help me... i will really appreciate anything that you can tell me, ideas and everything... tnx guys!
STRING
TABLE-MONTH(WS-MONTH) DELIMITED BY SIZE,
' ' DELIMITED BY SIZE,
WS-DAY-ALPHA DELIMITED SIZE,
', 20' DELIMITED BY SIZE,
WS-YEAR DELIMITED BY SIZE
INTO DTL-DATE
END-STRING.
In this string WS-DAY-ALPHA is used to display day (i.e, 5 or 20).
Declare this as WS-DAY-ALPHA pic x(2).
then AUG 5, 2006 will be displayed as AUG 05, 2006.
@David I was required to use STRING statement... but i will try your suggestion, dat statement is kinda new to me, never seen statement like that before... correct me if i'm wrong, bout DTL-DATE(5:1) = '0'
do the 5 points to the 5th character, ryt? and the 1 indicates the length?
ACCEPT WS-DATER FROM DATE.
compute yy1 = yy + 2000.
move mm to mm1.
move dd to dd1.
display ws-date.
move table-month(mm1) to ws-month.
move dd1 to e-dd.
if a-dd1 not = 0
STRING
WS-MONTH DELIMITED BY SIZE,
' ' DELIMITED BY SIZE,
e-dd DELIMITED by size,
', ' DELIMITED BY SIZE,
yy1 DELIMITED BY SIZE
INTO DTL-DATE
END-STRING.
if a-dd1 = 0
STRING
WS-MONTH DELIMITED BY SIZE,
' ' DELIMITED BY SIZE,
a-dd2 DELIMITED by size,
', ' DELIMITED BY SIZE,
yy1 DELIMITED BY SIZE
INTO DTL-DATE
END-STRING.
display dtl-date.