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

Value in variables after REDEFINES


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Wed Dec 29, 2010 12:47 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


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