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 should i define the Amout varaible.

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

New User


Joined: 01 Jul 2005
Posts: 4
Location: mumbai

PostPosted: Fri Jul 01, 2005 1:17 pm    Post subject: How should i define the Amout varaible.
Reply with quote

How should i define the Amout varaible, so that i can perform arithmetic operations on it without getting s0c7 abend.
Eg: amout = 12345678912345.1234
Back to top
View user's profile Send private message

pnk079

New User


Joined: 28 Jun 2005
Posts: 5
Location: Mysore, Karnataka, India

PostPosted: Fri Jul 01, 2005 4:46 pm    Post subject: Re: How should i define the Amout varaible.
Reply with quote

veeru wrote:
How should i define the Amout varaible, so that i can perform arithmetic operations on it without getting s0c7 abend.
Eg: amout = 12345678912345.1234


Declare it as'

amount pic 9(14)v9999 value 12345678912345.1234 and use this numeric literal for arithmetic operations.

OR amount pic s9(14)v9999 for u r saving signed values and to prevent them from SOC-7, do initialize this numeric variable, in the program before population and usage.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Jul 02, 2005 10:32 pm    Post subject:
Reply with quote

Hi Veeru,

It depends on how the value got into your pgm. If you defined it as a literal (with the decimal point) then pnk079 is correct.

If the value was read from a file (with the decimal point) or passed by another pgm via CALL, etc. then you must define the PIC as 9(14).9999. You must then move it to another field defined as 9(14)V9999.

This eliminates the decimal point clearing the way for you to successfully perform arithmetic operations on the field.
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 VSAM define for large file jerryte JCL & VSAM 9 Wed Oct 05, 2016 1:51 am
No new posts How to define PCB for paired segments ashok_uddaraju IMS DB/DC 4 Tue Jun 14, 2016 11:40 pm
No new posts Define Alias for multiple Data sets u... sandy98669 JCL & VSAM 4 Fri May 27, 2016 1:07 pm
No new posts trying to define a VSAM Cluster in JCL t5590ag JCL & VSAM 10 Thu May 19, 2016 5:52 am
No new posts Need Help to Define 36 Input Fields (... satish.ms10 CLIST & REXX 2 Sat May 07, 2016 3:08 pm

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