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 difference between Normal vaiable and comp variable.

5 Answers   DELL,


What is the difference between comp and comp-3?

0 Answers  


What is EIBCALEN? Why it is used?

9 Answers   ADP,


What are the cobol coding sheets?

0 Answers  


Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

0 Answers   IBM,






What is the difference between Structured COBOL Programming and Object Oriented COBOL ?

1 Answers  


Consider the following: 77 W-NUM PIC 9 VALUE 0 ------ MOVE 1 TO W-NUM PERFORM PARA-X UNTIL W-NUM > 9. ------ PARA-X ADD 1 TO W-NUM How many times PARA-X is executed ?

14 Answers   Accenture, TCS,


I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.

0 Answers   Cap Gemini,


If i have a variable A pic 9(2) value 10 Compute A = a - 100 what will be the value of A and will there be any error becoz of the Negative value

3 Answers   CTS,


A table has two indexes defined. Which one will be used by the SEARCH?

0 Answers  


why mainframe we use not like java as frontend oracle as backend. or not word excel.In there also huge ammount data stored.

2 Answers   TCS,


Whats the use of Examine command? can someone help me?

1 Answers   IBM,


Categories