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
 
how can i move s9(9) to s9(9) usage comp

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

New User


Joined: 05 Nov 2017
Posts: 1
Location: India

PostPosted: Mon Nov 06, 2017 12:10 am    Post subject: how can i move s9(9) to s9(9) usage comp
Reply with quote

Code:
 

10 QUANTITY PIC S9(9)

10 QTY          PIC S9(9) USAGE COMP

ACCEPT QUANTITY
MOVE QUANTITY TO QTY



Quote:

please tell me how to move integer to comp variable.

QUANTITY is accepting from screen, so it cant be comp.
QTY is host variable of DB2 Integer data type

Please let me know i m making a wrong approach and hw to correct it


[/b]
Back to top
View user's profile Send private message

prino

Senior Member


Joined: 07 Feb 2009
Posts: 1067
Location: Oostende, Belgium

PostPosted: Mon Nov 06, 2017 12:35 am    Post subject:
Reply with quote

You're on the wrong forum.

Sheesh, doesn't the organisation you work for provide any training?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1922
Location: UK

PostPosted: Mon Nov 06, 2017 4:08 pm    Post subject:
Reply with quote

a) experiment
b) read the manual
c) move to the beginner's forum
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8187
Location: East Dubuque, Illinois, USA

PostPosted: Mon Nov 06, 2017 7:34 pm    Post subject: Reply to: how can i move s9(9) to s9(9) usage comp
Reply with quote

You need to go to Beginners and Students Forum as this forum is for professionals with experience. Your question indicates you are not a professional with experience, so you should be posting on the other forum.

As far as moving S9(9) to S9(9) COMP, you can use these COBOL verbs to do so: MOVE, COMPUTE, ADD, SUBTRACT, MULTIPLY, DIVIDE -- all of them, appropriately coded, will cause the S9(9) COMP variable value to be set to the S9(9) variable value.

One thing you need to be aware of is that ACCEPT QUANTITY means you need to provide a 9-digit value with the sign overlaid on the last digit and leading zeroes; putting in 123 without the leading zeroes means that QUANTITY will contain 123 left-justified with trailing spaces -- so the results you get will NOT be what you expect. Depending upon what is entered, the MOVE statement may well generate a data exception.
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 CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 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 )SEL and )ENDSEL usage cvnlynn TSO/ISPF 4 Thu Jun 15, 2017 1:15 am
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am

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