Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
HARENDRA CHOUDHARY

New User

Joined: 05 Nov 2017
Posts: 1
Location: India

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

 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]

prino

Senior Member

Joined: 07 Feb 2009
Posts: 1210
Location: Vilnius, Lithuania

 Posted: Mon Nov 06, 2017 12:35 am    Post subject: You're on the wrong forum. Sheesh, doesn't the organisation you work for provide any training?
Nic Clouston

Global Moderator

Joined: 10 May 2007
Posts: 2378
Location: Hampshire, UK

 Posted: Mon Nov 06, 2017 4:08 pm    Post subject: a) experiment b) read the manual c) move to the beginner's forum
Robert Sample

Global Moderator

Joined: 06 Jun 2008
Posts: 8553
Location: Dubuque, Iowa, USA

 Posted: Mon Nov 06, 2017 7:34 pm    Post subject: Reply to: how can i move s9(9) to s9(9) usage comp 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.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Any limit on usage of cursors ? Jeethendra DB2 1 Sun Jul 12, 2020 10:23 am Write 9(07) comp-3 data into output file clearskynot DFSORT/ICETOOL 4 Thu Apr 16, 2020 11:00 pm Usage of processor directive and firs... Sakthidevi PL/I & Assembler 4 Fri Apr 10, 2020 6:27 pm usage of CASE in WHERE clause abdulrafi DB2 10 Wed Mar 18, 2020 4:25 pm Reading the CSV data in COBOL and mov... wik123 COBOL Programming 4 Tue Dec 03, 2019 5:13 pm

 © 2003-2020 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us