Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Value in variables after REDEFINES

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ilakkia
Warnings : 1

New User


Joined: 17 May 2008
Posts: 28
Location: chennai

PostPosted: Wed Dec 29, 2010 12:25 am    Post subject: Value in variables after REDEFINES
Reply with quote

If VAR1 is defined as below,

02 VAR1 PIC S9(2)V9(3).

and VAR2 redefines VAR1 as below,

02 VAR2 REDEFINES VAR1.
03 VAR2-A PIC X(2).
03 VAR2-B PIC X(3).

What will be value in VAR2-A and VAR2-B after the processing of below
MOVE statement?
MOVE -23.451 TO VAR1.

Thanks
Ilakkia
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Dec 29, 2010 12:47 am    Post subject:
Reply with quote

Hello,

What happened when you tried this?

If you haven't tried this, do so now and post the result here with any doubt you might have about the result.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Wed Dec 29, 2010 11:59 am    Post subject:
Reply with quote

VAR-1 = X'F2F3F4F5D1'

So VAR2-A = X'F2F3'
and VAR2-B = X'F4F5D1'

Note that Redefines never causes a change in value. Its just two variables occuping same memory.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Is it possible to pass variables of s... Csongor CLIST & REXX 2 Fri Jun 10, 2016 7:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us