HOW TO MOVE REDEFINES CLAUSE FROM INPUT TO OUTPUT ?



HOW TO MOVE REDEFINES CLAUSE FROM INPUT TO OUTPUT ?..

Answer / adarsha

01 ws-misc-vars.
05 system-date pic x(06) value spaces.
05 system-date-rede redefines system-date
10 system-dt-yy pic x(02) value spaces.
10 system-dt-mm pic x(02) value spaces.
10 system-dt-dd pic x(02) value spaces.

01 ws-rep-dt-frmt pic x(06) value space.
.
.
.

procedure division.

move system-date to ws-rep-dt-frmt.

*** when you want any particular variable to be recevied or
stored in a particular format you can redefine them in the
way you want.. here system-date-rede has the same value as
system-date !

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More COBOL Interview Questions

I have a source program compiled with Cobol-2. The output file has a record length of 100 defined in the program but a record of 60 bytes getting written into it. i.e. The rest of 40 bytes I am not Writing anything. But it by default puts some values into the last 40 bytes. However it does not impact anything. But when Compiled the module with Enterprise Cobol the last 40 bytes were spaces as fillers. Can anyone explain?

5 Answers   Cognizant,


What are all the divisions of a COBOL program?

0 Answers  


Define cobol?

0 Answers  


how can count the number of character in feild ?? suppose for instance i have a feild with value ' rajesh sarkar' then how can v count the number of characters whitout spaces...........

4 Answers   Wipro,


what is the purpose of linkage section?

10 Answers  


What is the difference between working storage copybook and linkage section copybook?

5 Answers   TCS,


How do we get current date from system with century in COBOL?

0 Answers   Winsol Solutions,


How can you submit a job from COBOL programs?

2 Answers   ITC Infotech,


What is binary search?

3 Answers  


What is the difference between COMP & COMP-3 ?

2 Answers  


how can we find total no of records in a file ....is there any utility......?

3 Answers   IBM,


what happens when a copybook variables are declared using include statement ?

3 Answers   IBM,


Categories