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
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm


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