IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How should i define the Amout varaible.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts Define default volume for DSN storage... JCL & VSAM 8
No new posts define 1 DCB parms for multiple outpu... JCL & VSAM 9
This topic is locked: you cannot edit posts or make replies. REXX to find /* Define and write the ... CLIST & REXX 5
No new posts How to define transaction that trigge... CICS 3
Search our Forums:

Back to Top