Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

i friends greetings to the day...!!! I face a quation like"while runnig the programe every day i have to access the previous day updates only...!! Ex:- Let last day 100 customers took bank account i have to select those customers only.."

4 Answers   CSC,


I have a source program compiled with Cobol-2. The output file has a record length of 100 defined in the program but a record of 60 bytes getting written into it. i.e. The rest of 40 bytes I am not Writing anything. But it by default puts some values into the last 40 bytes. However it does not impact anything. But when Compiled the module with Enterprise Cobol the last 40 bytes were spaces as fillers. Can anyone explain?

5 Answers   Cognizant,


HOw can I get the negative sign while deduct high value from low value

0 Answers  


what is the maximum error code in mainframe

2 Answers  


What is the default value of DISP parameter?

3 Answers   IBM,






COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'

8 Answers   Barclays, IBM,


can we use the two 01 level in file discription ?

6 Answers  


What is the point of the REPLACING option of a copy statement?

3 Answers  


If there are two copybooks which have same variables and we are using both the copybooks in our program. will there be an error and if i move values to the variable which copybook varibales gets the values i move in.

3 Answers   CTS,


Name the divisions, which are available in a cobol program?

0 Answers  


Why do we use COMP-3 variables for computation, when we know that they are non displayable fields and require additional MOVE to numeric field before we populate it in output Reports?

1 Answers   Accenture,


Suppose a program has the following code. What will be the output? MAIN-PARA. DISPLAY 'MAIN-PARA' PERFORM SECTION-A. STOP RUN. SECTION-A. PARA-A1. DISPLAY 'SECTION A PARA A1'. PARA-A2. DISPLAY 'SECTION A PARA A2'.

4 Answers  






Categories