Is this allowed?

01 WS-TABLE.

03 FILLER-X PIC X(5) VALUE 'AAAAA'.

03 WS-EX REDEFINES FILLER-X OCCURS 5 TIMES PIC X(1).

can redefines clause be used with occurs clause?

Answers were Sorted based on User's Feedback



Is this allowed? 01 WS-TABLE. 03 FILLER-X PIC X(5) VALUE 'AAAAA'. 03 WS-EX RED..

Answer / ankur

Yes. Redefines just causes both the fields to be started at
the same location. We can even redifine a A(100) with B
(200) and the other way round.

Is This Answer Correct ?    5 Yes 0 No

Is this allowed? 01 WS-TABLE. 03 FILLER-X PIC X(5) VALUE 'AAAAA'. 03 WS-EX RED..

Answer / sandy

Bob, using occurs under redefines is also possible.
example.
01 WS-REF-TABLE.
05 WS-DATA1 PIC X(8) VALUE 'TEST '.
05 WS-DATA2 PIC X(8) VALUE 'COBOL '.
01 WS-RED-TABLE REDEFINES WS-REF-TABLE.
10 WS-RED-DATA OCCURS 2 TIMES PIC X(8).

Is This Answer Correct ?    3 Yes 1 No

Is this allowed? 01 WS-TABLE. 03 FILLER-X PIC X(5) VALUE 'AAAAA'. 03 WS-EX RED..

Answer / bob

Yes we can use redefine under occurs clause but we cannot
use occurs under redefine

Is This Answer Correct ?    2 Yes 1 No

Is this allowed? 01 WS-TABLE. 03 FILLER-X PIC X(5) VALUE 'AAAAA'. 03 WS-EX RED..

Answer / frankie

What is diff betn 'Occurs under Redefines' and the vice
versa?

Confused...Can you help?

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

how can we fetch 3 records in cobol pgm any coding pls ?

3 Answers   CGI,


hi, can you ppl tell me, how to check whether the rewrite we gave for the ksds file is successful or not in the program.? i gave rewrite, the rewrite code is executing and maxcc=0 but updation doenot happen in the file?

1 Answers   CGI,


I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue

0 Answers   IBM,


why 02 level number can't be use as a separate level number like 01 or 77 ?

3 Answers  


What is Static,Dynamic linking ?

2 Answers  






What do you feel makes a good program?

2 Answers  


In a COBOL program, 2 tables TABLE1 and TABLE2 are defined that are indexed by INDEX1 and INDEX2 respectively. Can we use INDEX1 with TABLE2 and INDEX2 with TABLE1?

1 Answers  


What are the divisions in a cobol program? Which one is the mandatory division among them?

1 Answers  


what is level 66 means??

7 Answers  


Why occurs can not be used in 01 level ?

2 Answers   TCS,


how will u find out 3rd week's 2nd day using occurs ?

3 Answers   L&T,


I got user abend U4038 while compiling my runjcl.. can anyone help me?

10 Answers   CGI,


Categories