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
 
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 display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts Display upon console bipinpeter COBOL Programming 1 Thu Jun 22, 2017 12:35 am

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