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 |
what is index and how to use two tables using index?
plz any one tell clearly the justify right clause?
can we declare s9(9)v9(9) in cobol ? if yes how many bytes it will occupy ?(urgent plz answer it)
HOw can I get the negative sign while deduct high value from low value
i have mainprogram and subgram...if i compile mainprogram without stop run..what will u get in compilation time?
What is the difference between a binary search and a sequential search what are the pertinent cobol?
How many bytes do a s9 (7) comp-3 field occupy?
Which of the following characters is NOT valid in column 7? a. - b. \ c. * d. # e. $
which certifications r 4 cobol,jcl,db2,cics what is format of xam n what is importance of these certifications... plz post answer only if u r sure... thanks
If i got a job on mainframe technology, will i have a bright future?. Some people are discouraging me. Let me know, is it true? Please bring back me from the confusion.
I am sending values a and b with pic x(10) and pic x(10) by using call statement. In linkage section, I am receiving values with pic x(10) and pic x(11). Will my program fail? will it be compile error or run time abend?
What is the maximum data length for Numeric DataType ?