how to display date in reverse order if the pic clause of
the is numeric
suppose date is 09032010 ==> need to print in 20100309
(pic clause is numeric)
Answer Posted / reshma j.
INPUT-DATE has value of 09032010.
In working storage:
01 INPUT-DATE.
03 MM1 PIC 9(2).
03 DD1 PIC 9(2).
03 CCYY1 PIC 9(4).
01 PRINT-DATE.
03 CCYY2 PIC 9(4).
03 DD2 PIC 9(2).
03 MM2 PIC 9(2).
In Procedure Division:
MOVE MM1 TO MM2.
MOVE DD1 TO DD2.
MOVE CCYY1 TO CCYY2.
After Moving values,PRINT-DATE value will be 20100309.
In this cond,Its totally depend on how we declare format in
working storage section.
plz let me know,if i m wrong.
| Is This Answer Correct ? | 14 Yes | 1 No |
Post New Answer View All Answers
What is the difference between perform … with test after and perform … with test before?
What is length is cobol?
Describe the cobol database components?
What is a SSRANGE and NOSSRANGE?
System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..
Write a program to explain size error.
What is the difference between comp and comp-3 usage?
For rewrite, why is it mandatory that file needs to be opened?
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
how do you reference the fixed unblock file formats from cobol programs
What is the difference between goback, stop run and exit program in cobol?
What is the difference between Global and External Variables?
In which area will you utilize 88 level items in cobol?
What guidelines should be followed to write a structured cobol prgm?