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
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 |
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 |
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 |
Answer / sunil
This works on MF-COBOL
Display WS-EX will display AAAAA
| Is This Answer Correct ? | 1 Yes | 4 No |
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 |
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 ?
what is sort? whis is internal & external sort ?when do u go for inter sort & external sort? tell about some sort utilites?
can any one help -s806
A table has two indexes defined. Which one will be used by the SEARCH?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
plz any one tell clearly the justify right clause?
what is sync clause?
suppose a cobol programme A calling programme B,C and D. If C undergoes some change what if A,B,C,D need to be recompiled or only C nee to be recompliled.
study the following code 01 A1 05 B PIC 99 05 C PIC X(4) 01 A2 05 B PIC 99V99 05 C PIC A(4) pick out the valid statement from the following a.A1 and A2 can not have sub-ordinates b.A1 and A2 can have the same sub-ordinates but must have same PIC clause c.there is nothing wrong d.A1 and A2 can have same sub-ordinates provided they are not at 01 level
Without using move verb how to move one variable to another.
what is the difference between Normal vaiable and comp variable.
I want to declare a field with data type Double in my COBOL program. how shall i do that ?