srimsc_ibmmainframes
New User
Joined: 17 Feb 2004 Posts: 19 Location: pune
|
|
|
|
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) |
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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. |
|