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
 

 

Can we move '123' to a PIC S9(09) COMP variable?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Yoyoyo

New User


Joined: 19 Sep 2006
Posts: 26

PostPosted: Fri Oct 27, 2006 5:19 pm    Post subject: Can we move '123' to a PIC S9(09) COMP variable?
Reply with quote

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
View user's profile Send private message

shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Fri Oct 27, 2006 5:31 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Yoyoyo

New User


Joined: 19 Sep 2006
Posts: 26

PostPosted: Fri Oct 27, 2006 5:42 pm    Post subject:
Reply with quote

Thanks shreevamsi for your reply!

But let me know if anyone else has got a different opinion.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Oct 27, 2006 5:57 pm    Post subject:
Reply with quote

Hi There,

Its not throwing ne error when moving '123' to comp variable.
& Result is also same 000000123.
Back to top
View user's profile Send private message
Yoyoyo

New User


Joined: 19 Sep 2006
Posts: 26

PostPosted: Sat Oct 28, 2006 1:04 pm    Post subject:
Reply with quote

Thanks Ekta for the confirmation! :-)
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Sat Oct 28, 2006 9:47 pm    Post subject:
Reply with quote

Hi Yoyoyo,

Glad I could help.
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 Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm


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