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 different data types in cobol?

785


Define cobol?

856


How to remove 2 duplicate records and copy only one using job control language?

732


Write the code to count the sum of n natural numbers.

697


what is search and searchall?what is the diffrence between them?give an best example?

5538






What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?

670


What the difference is between continue and next sentence?

651


I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.

1107


1.give the details about WHEN OTHER. 2. how many form are available in evaluate.

1606


Which is not true about evaluate statement

1565


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

813


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

620


how do you reference the variable block file formats from cobol programs

676


) what is the difference between AID and HANDLE AID?

1628


How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

3711