Can we use redefine clause in occurs clause?

Answers were Sorted based on User's Feedback



Can we use redefine clause in occurs clause?..

Answer / leroy

Answer #2 is incorrect for IBM COCOL compiler.

Answer #1 is correct but incomplete. a) "VALUE" close can
not be used in occurring fields b) Occuring fields are the
ones that will redefine other fields not the other way
round.
Example: CORRECT
01 LIT-FIELD PIC X(21) VALUE 'SUNMONTUEWEDTHUFRISAT'.
01 DAYS REDEFINES LIT-FIELDS.
05 WEEK-DAY OCCURS 7 PIC X(03).
INCORRECT:-
01 DAYS.
05 WEEK-DAY OCCURS 7 PIC X(03).
05 LIT-FIELDS REDEFINES WEEK-DAY VALUE 'SUNMONTUE.........'

Is This Answer Correct ?    16 Yes 2 No

Can we use redefine clause in occurs clause?..

Answer / manthan

yes........we can redefine occurs clause but not having
depending clause

Is This Answer Correct ?    6 Yes 1 No

Can we use redefine clause in occurs clause?..

Answer / jagadesh

not possible because memory allocation can not be
reallocated

Is This Answer Correct ?    4 Yes 3 No

Can we use redefine clause in occurs clause?..

Answer / john

All fine but, Nikhitha's Question has to be confirmed
first;
1. Whether a redefines can be used within an occurs (OR)
2. Whether an occurs can be redefined?

Looks like Nikhita's Question is 1, but all of your answers
were for Question 2.

Is This Answer Correct ?    2 Yes 1 No

Can we use redefine clause in occurs clause?..

Answer / sroul4

Redefines is just a pointer to the memory add, thus can be
done.

Is This Answer Correct ?    1 Yes 0 No

Can we use redefine clause in occurs clause?..

Answer / saravanan

yes we can use redifines claues at level num 01... and alos
we can use both (redifine and occurs clause) together......

Is This Answer Correct ?    2 Yes 2 No

Can we use redefine clause in occurs clause?..

Answer / sivakumar sekharannair

Leroy's answer is correct. Redefined variable can have
occurs clause not in the same level but subordinate to the
higher level

Is This Answer Correct ?    1 Yes 1 No

Can we use redefine clause in occurs clause?..

Answer / subharaj

We can do that. I have done it multiple times and it works
in Enterprise Edition in mainframe.

Is This Answer Correct ?    0 Yes 0 No

Can we use redefine clause in occurs clause?..

Answer / srinivasulu

no no no no no anyone can bet on this

Is This Answer Correct ?    1 Yes 2 No

Can we use redefine clause in occurs clause?..

Answer / saravanan

answer from leroy is exactly correct ......

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More COBOL Interview Questions

I have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSDS file in reverse order? In both the cases we donot know the total number of records.

2 Answers   L&T,


What is the difference between comp and comp-3?

0 Answers  


Consider the below example call a-test1. -- -- -- a-test1. if a=b perform a-test through a-exit next sentence else if b=c perform c-test through c-exit. if a=d perform d-test through d-exit. a-test. -- -- a-exit. exit. can u tell me what will happen if a=b after looping into a-exit will the control go back to a- test1. will the condition a=d be checked???

5 Answers   IBM,


Can we redefine the field of x(200) to less than 200?

0 Answers  


How include time & date in the report generation in cobol programing?

2 Answers  






How To move a value to an array using move verb?

3 Answers   IBM,


01 WS-NAME PIC X(10) OCCURES 2. by this we can get ws-name 2 times. My qustion is how can we access the second name

5 Answers   TCS,


If you were passing a table via linkage, which is preferable - a subscript or an index?

3 Answers   TCS,


in a indexed file what is procedure for read the records from 12 to 18. please give the code example

2 Answers   L&T,


What is wrong with the following data declaration? 01 W-DATE PIC X(6). 05 DD PIC 99. 05 MM PIC 99. 05 YY PIC 99. (a) Nothing is wrong. (b) Under W-DATE all level 05 items are having a PIC 99 but level 01 has PIC X(6). (c) PIC can't be specified for a group item. (d) DD, MM, and YY are invalid datanames.

6 Answers   Mphasis, TCS,


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

0 Answers   IBM,


Program A calls program B. Will the working storage variables declared in program B be initialized every time it is called by program A or will the values be retained until the end of program A?

7 Answers  


Categories