Explain about Redefines cluse?
Answers were Sorted based on User's Feedback
Answer / amit barwa
REDEFINES Clause
Facilitates two or more data-names to point to the same
memory location
e.g.
01 WS-NUM1 PIC X(1)
01 WS-NUM2 REDEFINES WS-NUM1 PIC X(2).
If you MOVE '10' to WS-NUM2,
DISPLAY WS-NUM1 will show 1 while
DISPLAY WS-NUM2 will show 10.
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / avinanda mukherjee
If the example is-
01 WS-NUM1 PIC 9(1)
01 WS-NUM2 REDEFINES WS-NUM1 PIC X(2).
If you MOVE '10' to WS-NUM2,
DISPLAY WS-NUM1 will show 0 (Numeric) while
DISPLAY WS-NUM2 will show 10 (charecter).
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / mallappa
Redfeines Clause allows you to use a same memory area.
Ex:
01 var.
02 ws-date pic x(10).
02 ws-date1 Redefines ws-date
03 ws-day pic x(2).
03 ws-month pic x(2).
03 ws-month pic x(8).
| Is This Answer Correct ? | 3 Yes | 0 No |
how many bytes does a s9(12)COMP-4 field occupy?? a.2 b.4 c.8 d.1 ans with reason please
why 02 level number can't be use as a separate level number like 01 or 77 ?
Can we MOVE X(9) to 9(9) OR 9(9) to X(9)? If yes what are the ways for doing this?
12 Answers T systems, Tech Mahindra,
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.
can we use go to statement inline-perform?
If we use GO BACK instead of STOP RUN in cobol?
what is label record is standard or omitted in file description of data division?
What are literals?
I have the file which is having the extension no as records. sample file will look like below. 2310 3410 3256 4350 3781 5408 I need to replace the record which is starting with 3 to 5 (i.e) 3410 to 5410. How can we do it through cobol and cobol-db2 program? I need the possible logic?
can i give 9(10) in comp 3 instead of s9(10) ? if i can give wht would be ths ans
Consider the following COBOL entries 05 X PIC 99 VALUE 10. ADD 40 X TO X. COMPUTE X = 3 * X - 40. The result in X is
If by mistake we MOVE a working storage variable into LINKAGE area. What will happen??