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

where will u code file status ?

2 Answers   TCS,


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,


Explain Restart Logic in Cobol?

1 Answers   L&T, Syntel,


What is the difference between perform … with test after and perform … with test before?

0 Answers  


How may divisions are there in JCL-COBOL?

5 Answers   IBM,






) How do u handle errors in BMS macro?

0 Answers   IBM,


Hi, My interviewer ask A calls B and C calls B, a and b are static c and b are dynamic.what happens if they compile and execute at same time.

3 Answers   iGate,


The order of precedence of arithmetic operators in an expression can be overridden with the use of (a) [] (b) () (c) {} (d) Any of the above

3 Answers   TCS,


01 a pic x(4) value 'abcd' 01 b pic 9(3) can we move from a to b.if possible what would be stored in b.

15 Answers   ACS,


What is the usage of comp fields in cobol?

0 Answers  


How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

0 Answers  


How can we increase the size of an existing PDS to include more no. of modules.

3 Answers  


Categories