View previous topic :: View next topic
|
Author |
Message |
Yoyoyo
New User
Joined: 19 Sep 2006 Posts: 26
|
|
|
|
Can we move '123' to a PIC S9(9) COMP variable?
If yes, what is the difference between
MOVE '123' TO <PIC S9(09) COMP variable> and
MOVE 123 TO <PIC S9(09) COMP variable>? |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
hi
You can't move '123' intp PIC S9(9).
Within quotes, if you move some value to a variable, it is expected to be a alphanumeric. In your case...your receiving variable is declared as numberic.
If
77 VAR1 PIC S9(09) COMP
then you can only
MOVE 123 TO VAR1
but not '123'
got it??
~Vamsi |
|
Back to top |
|
|
Yoyoyo
New User
Joined: 19 Sep 2006 Posts: 26
|
|
|
|
Thanks shreevamsi for your reply!
But let me know if anyone else has got a different opinion. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi There,
Its not throwing ne error when moving '123' to comp variable.
& Result is also same 000000123. |
|
Back to top |
|
|
Yoyoyo
New User
Joined: 19 Sep 2006 Posts: 26
|
|
|
|
Thanks Ekta for the confirmation! :-) |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Yoyoyo,
Glad I could help. |
|
Back to top |
|
|
|