View previous topic :: View next topic
|
Author |
Message |
veeru Warnings : 1 New User
Joined: 01 Jul 2005 Posts: 4 Location: mumbai
|
|
|
|
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 |
|
|
pnk079
New User
Joined: 28 Jun 2005 Posts: 5 Location: Mysore, Karnataka, India
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
|