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

If we display the value of b after redefining


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vinayn

New User


Joined: 13 Jun 2005
Posts: 10

PostPosted: Wed Aug 10, 2005 1:48 pm
Reply with quote

01 Group variable.
02 a pic 9(5) Value is 12345.
02 b redefines a.
Display b .

suppose if b contains some value which was declared in the program elsewhere(before redefines) ... and if we display the value of b after redefining .. will it be 12345 or the value of b...(think that b has a value of 6789.)

i mean to ask that it will only take the storage area only or value of the storage area that it contains..

Whether the B value contains 12345 or 6789.
Back to top
View user's profile Send private message
thanooz

New User


Joined: 28 Jun 2005
Posts: 99

PostPosted: Wed Aug 10, 2005 2:19 pm
Reply with quote

HI,

YOU CAN NOT DEFINE THE B BEFORE REDIFINE BECAUSE IT GIVES ERROR 'USER WORD IS MULTI-DEFINED'. 'ITEM REDEFINED BY REDEFINES CLAUSE IS NOT DEFINED CORRECTLY'.

IT WILL IDENTIFING STORAGE AREA MEANS IT WILL AUTOMATICALY STORAGE VALUE ALSO.

THANKS,
THANOOZ.
Back to top
View user's profile Send private message
Karthikt

New User


Joined: 15 Aug 2005
Posts: 51

PostPosted: Mon Aug 15, 2005 11:23 am
Reply with quote

Hi,
You can move a value to 'b' down the line in the program. And if you issue DISPLAY statement it will display the value of B. I verfied this information in File aid.
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Mon Aug 15, 2005 8:50 pm
Reply with quote

What thanooz and Karthikt said are both true, coming back to ur Q.

Quote:
suppose if b contains some value which was declared in the program elsewhere(before redefines) ...


This can never happen as u cannot define a variable twice, u wud get an error like what thanooz said. The storage area can contain only one value at a time, suppose if u have 12345 in it originally, both A and B will have it . Unless down in Procedure Division u move another value to it.
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 How to display the leading zeros of a... DB2 7
No new posts SDSF display Max-RC in different colors TSO/ISPF 4
No new posts Converting a file from PD to display ... SYNCSORT 4
No new posts Unable to display comp variable COBOL Programming 4
No new posts Adding FIND to ISPF Panel display of ... TSO/ISPF 3
Search our Forums:

Back to Top