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 |
For rewrite, why is it mandatory that file needs to be opened?
which one is the best of com and com-3.using of real time ?
a pic s9(4) comp b pic s9(4) comp-3 c ???????????????? d ???????????????? move a to c add a+B giving d. what is ur declaration for c,d?
How do u initialize an array?
What is "Call by content" and "call by reference"?
Why we are using comp and comp-3 in real time projects?
What is the difference between external and global variables in COBOL?
Did anybody attend the walkin of TCS on 31st July in Gurgaon for any technology,If u have completed 3 round i.e till the HR round,have u received the Offer letter yet? Please let me know.Thanks.
HOW WE WILL SORT THE ARRAY WHICH IS GOING TO USE FOR SEARCH ALL?
how we rectify soc4 and soc7 error in project(need real time answer)? please reply
What is diff betn PS and ESDS file? What is the diffrent compiler options in cobol and there discription? What is retrive nth maximum salary from salary DB2 table. Can we redefine COM-3 variable with varchar variable?
How to read the last 100 records from a COBOL file. The file contains N number of records.