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
 

 

doubt abt redefines

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
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

mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

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
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 Doubt in MFS abdulrafi IMS DB/DC 2 Fri Oct 21, 2016 3:09 pm
No new posts Doubt on GETMAIN, FREEMAIN behaviour Arunkumar Chandrasekaran CICS 3 Sun Aug 30, 2015 9:22 pm
No new posts Another redefines in COBOL RahulG31 COBOL Programming 1 Fri Mar 20, 2015 4:09 am
No new posts Doubt in using command code O Appu IMS DB/DC 4 Tue Jan 13, 2015 3:14 pm
No new posts Doubt in using command code D and N t... Appu IMS DB/DC 7 Mon Dec 29, 2014 5:52 pm


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