Can a REDEFINES clause be used along with an OCCURS clause?
if yes,
01 WS-TABLE.

03 WS-TABLE-EL OCCURS 5 TIMES PIC X(1) VALUE 'A'.

03 WS-EX REDEFINES WS-TABLE-EL PIC X(5). What can you
expect?
if no,why?


Answers were Sorted based on User's Feedback



Can a REDEFINES clause be used along with an OCCURS clause? if yes, 01 WS-TABLE. 03 WS-TAB..

Answer / guest

Hi All,

The following combinations are possible with REDEFINES and
OCCURS clause.

1.Variable at level 01 can be redefined.
2.VALUE clause cannot be used along with the REDEFINES
clause.
3.Variable having OCCURS clause cannot be REDEFINED.
4.Variable at level 01 cannot have OCCURS clause.

Please correct if any of the above points are wrong.

Is This Answer Correct ?    7 Yes 1 No

Can a REDEFINES clause be used along with an OCCURS clause? if yes, 01 WS-TABLE. 03 WS-TAB..

Answer / vikas sharma

This clause work as when u have define this another 01 level..
We can not define like this...

Is This Answer Correct ?    1 Yes 2 No

Can a REDEFINES clause be used along with an OCCURS clause? if yes, 01 WS-TABLE. 03 WS-TAB..

Answer / vikas sharma

Yes, We Can.
In this question, When we display WS-EX we will get the
answer 5 times A. Like this AAAAA .

Is This Answer Correct ?    0 Yes 2 No

Can a REDEFINES clause be used along with an OCCURS clause? if yes, 01 WS-TABLE. 03 WS-TAB..

Answer / v@m$i

REDEFINES IS NOT USED IN OCCURS CLAUSE.

Is This Answer Correct ?    0 Yes 2 No

Can a REDEFINES clause be used along with an OCCURS clause? if yes, 01 WS-TABLE. 03 WS-TAB..

Answer / sunil

This works on MF-COBOL

Display WS-EX will display AAAAA

Is This Answer Correct ?    1 Yes 4 No

Can a REDEFINES clause be used along with an OCCURS clause? if yes, 01 WS-TABLE. 03 WS-TAB..

Answer / anoop

It is possible to use redefine class along with OCCURS
class, but you cannot redefine a table directly. So the
above code wont work.

01 ws-table
03 ws-table-el redefines ws-ex occurs 5 times pic x(1).

This is valid one.

Is This Answer Correct ?    3 Yes 7 No

Post New Answer

More COBOL Interview Questions

What is the significance of the PROGRAM-ID paragraph? If this name doesnt match with the name of the COBOL program, does it make a difference? Is the name specified in the PROGRAM-ID paragraph used as a name for the load module or any such thing?

4 Answers   IBM,


Using string statement.Is coding three destination string from one source string possible in one code?or three codes for every destination string of one source string.?thank you

1 Answers   BPL,


wht is packed decimal in cobol

2 Answers  


What is the purpose of Identification Division?

1 Answers  


There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

0 Answers  






Can we use goto statement in inline_perform ?

5 Answers   IBM,


At the minimum, which division of COBOL is enough to be coded?

3 Answers   CTS,


The below is the declaration for a variable ws 01 ws pic 9(3). if you want to insert space how will you do that. in which level u should do it

3 Answers   ADP,


What are the steps you go through while creating a COBOL program executable?

3 Answers  


What do you do to resolve SOC-7 error?

2 Answers   Sun Life, Wipro,


How To move a value to an array using move verb?

3 Answers   IBM,


What are differences between Static Call and Dynamic Call?

10 Answers   IBM, KBC, Keane India Ltd, Verizon,


Categories