View previous topic :: View next topic
|
Author |
Message |
samayamsasi Warnings : 1 New User
Joined: 22 May 2005 Posts: 7 Location: Bangalore
|
|
|
|
Hi
This is sasi
interview questions on redefines
1. can we use redefining and redefined variables in one operation ?
ex:
IN A PGM
.
.
.
WORKING STORAGE SECTION.
01 A PIC X(2).
01 B REDEFINES A PIC X(4).
01 C PIC X(4).
PROCEDURE DIVISION.
MOVE 10 TO A.
MOVE 1000 TO B.
COMPUTE C = A+B.
DISPLAY C.
STOP RUN.
the above program works fine(or) not ? if not what error it shows?
2. for the above example
A occupies 2 bytes
B will be occupies 4 bytes
my question how B will be accomdate 4 bytes ?
waiting ur reply
Thanks & Regards
Sasi |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Sasi,
It would not abend because Redefines just causes both fields to start at the same location.
I think result should be 1010.
Others plz comment |
|
Back to top |
|
|
samayamsasi Warnings : 1 New User
Joined: 22 May 2005 Posts: 7 Location: Bangalore
|
|
|
|
Hi guptae,
thx ur reply
Please give answer for the second question ?
Thanks & Regards
Sasi |
|
Back to top |
|
|
|