Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us