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 |
I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a particular account number say 123456 in that file?
How may divisions are there in JCL-COBOL?
TYPES OF SORTINGS. which is more prefarable.
how many bytes do SPPPP999 will store?
wht is the difference between goto and perform stmts
There are two flat files one having 10 records and other having 5 records. write a cobol pgm to find the duplicate records(matching records)from both files.
In an array processing what is the thing that can be done by using subscripts but not by using index
. How do we cast a variable in COBOL
What COBOL construct is the COBOL II EVALUATE meant to replace?
what is the difference between PA & PF keys?
How many variables can be declared in w-s section.?
WHAT IS SOC3?HOW IT CAN BE RESOLVED?