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 / tata

id division.
program-id. exe.
data division.
working-storage section.
01 idate pic 9(8) value 10032010.
01 rdate pic 9(8).
procedure division.
move idate (1:2) to rdate (7:2).
move idate (3:2) to rdate(5:2).
move idate (5:4) to rdate(1:4).
display rdate.
stop run.

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention the guidelines to write a structured cobol program?

620


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 ......

10625


How can you get the ksds file records into your cobol program?

644


how we sort two input files based on a common column and giving one o/p file please send me the coding logic?

1657


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

634






What is an in line perform? When would you use it? Anything else you wish to say about it.

646


What is the difference between next sentence and continue in cobol programing language?

712


Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

825


Which is not true about evaluate statement

1586


Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

1701


What is the problem of ordered sequential files access?

702


Difference between array and sub-script ?

1169


How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?

710


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

666


What are the different rules for performing sort operation?

763