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

What is the default value(s) for an initialize? What keyword will allow for an override of the default?

0 Answers  


How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

0 Answers  


What is the LINKAGE SECTION used for?

4 Answers  


Discuss about changing dataset name in proc.

0 Answers  


Write a program to explain size error.

0 Answers  






how can we get current dat and time thru cobol pgm

3 Answers   DELL,


explain sorting techniques in cobol program?

0 Answers  


Minimum how many Number of Paragraphs are there in ID- Divison?

7 Answers   IBM,


what is MSGLEVEL?

1 Answers   IBM,


what is redefines? where it can be effectively use for the purpose of memory utilization? give an example?

4 Answers   IBM,


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.

0 Answers   Infosys,


How to convert bunch of words in a line to relvant ASCII values?

2 Answers  


Categories