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
 

 

If we display the value of b after redefining

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: If we display the value of b after redefining
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 pm


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