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

doubt abt redefines


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Doubt about pl/1 (job offer) General Talk & Fun Stuff 5
No new posts Cobol redefines for Signed pictured c... COBOL Programming 4
No new posts doubt when executing a file when logg... TSO/ISPF 2
No new posts Doubt in MFS IMS DB/DC 2
No new posts Doubt on GETMAIN, FREEMAIN behaviour CICS 3
Search our Forums:

Back to Top