IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

can weuse redefining and redefined variables inone operation


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
samayamsasi
Warnings : 1

New User


Joined: 22 May 2005
Posts: 7
Location: Bangalore

PostPosted: Tue Nov 07, 2006 5:10 pm
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Nov 07, 2006 5:31 pm
Reply with quote

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
View user's profile Send private message
samayamsasi
Warnings : 1

New User


Joined: 22 May 2005
Posts: 7
Location: Bangalore

PostPosted: Tue Nov 07, 2006 6:17 pm
Reply with quote

Hi guptae,

thx ur reply
Please give answer for the second question ?

Thanks & Regards
Sasi
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts JCL with variables JCL & VSAM 1
No new posts JCL Variables JCL & VSAM 1
No new posts reset/clear ALL application profile v... TSO/ISPF 3
No new posts REXX - Adding variables CLIST & REXX 8
No new posts using based or defined variables PL/I & Assembler 2
Search our Forums:

Back to Top