Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
can weuse redefining and redefined variables inone operation

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: can weuse redefining and redefined variables inone operation
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: 1187
Location: Bangalore,India

PostPosted: Tue Nov 07, 2006 5:31 pm    Post subject:
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    Post subject: Re: can weuse redefining and redefined variables inone opera
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Utility for search operation Gopalakrishna551 TSO/ISPF 11 Wed Jan 03, 2018 11:07 am
No new posts COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us