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


Please Help Members By Posting Answers For Below Questions

What are the pertinent COBOL commands?

2632


Explain how you can characterize tables in cobol?

652


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

648


What is cobol?

752


) what is the difference between AID and HANDLE AID?

1641






Can a Search can be done on a table with or without Index?

816


Define static linking and dynamic linking.

675


What are the cobol coding sheets?

673


I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......

10672


what is amode(24), amode(31), rmode(24) and rmode(any)?

707


Why would you use find and get rather than to obtain?

696


I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.

2020


What are the rules of the move verb?

712


Differentiate between structured cobol programming and object-oriented cobol programming.

673


how do you reference the ksds vsam file formats from cobol programs

671