Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
doubt abt redefines

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
srimsc_ibmmainframes

New User


Joined: 17 Feb 2004
Posts: 19
Location: pune

PostPosted: Sun Mar 06, 2005 12:24 pm    Post subject: doubt abt redefines
Reply with quote

Though i am going to ask u abt a basic question but it is bothering me for a while so plz try to provide me the correct answers for better understanding.

1.01 g-var
05 var1 pic x(20)
05 var2 redefines var1 pic x(20)

2.01 g-var
05 var1 pic x(20)
05 var2 redefines var1 pic 9(20)

for suppose i moved 1,2,3,...............20 to var1
so waht will happen in the above specified two cases.
(vs cobol ii)
Back to top
View user's profile Send private message
References
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1526

PostPosted: Mon Mar 07, 2005 12:28 am    Post subject:
Reply with quote

Hi Reddy,

As I recall the move is successful in both cases. What happens when you attempt to perform arith on the field depends on its contents. Also remember when you MOVE a numeric field to another numeric field of a different type (e.g. COMP or COMP-3) arith processing takes place. That is, the data is converted, as it is in arith functions, and that's where the error will occur.

As you've already noticed, you got two widelly different ans to your question. It's a ques that's easily answered by creating a small pgm to test both scenerios.

You should try to take that approach wherever you can. The computer is the final arbiter in all these situations. If the computer says it's so, you can take it to the bank.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1