View previous topic :: View next topic
|
Author |
Message |
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
I have a variable
Code: |
01 WS-AN630-RECUR-REV PIC X(8). |
VALUE of this variable '+5000.00'. which is coming from a dataset.
Now I want to do some compute on the above variable so I moved to variable below
Code: |
01 WS-AN630-RECUR-REV1 PIC S9(6)V99 COMP-3. |
When I do the below compute its giving SOC7 Abend
Code: |
COMPUTE WS-TI-BENMR-AMT =
(WS-AN630-RECUR-REV1 * 1.15) / 100 |
How I have to decalre the File variable to do the computation correctly? Please advice.. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
compute WS-AN630-RECUR-REV1 = numvalc(WS-AN630-RECUR-REV)
end-compute |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Dick,
Code: |
compute WS-AN630-RECUR-REV1 = numvalc(WS-AN630-RECUR-REV) |
Is it NUMVAL? |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
If I use
Code: |
compute WS-AN630-RECUR-REV1 = numvalc(WS-AN630-RECUR-REV) |
I will be loosing Sign when its -ve then the output will not be having -sign. |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Yes Its NUMVAL not NUMVALC |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
I have used
WS-TI-BENMR-AMT as
Code: |
01 WS-TI-BENMR-AMT PIC -9(5).99. |
its working for both +ve and -ve Values |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
shrivatsa wrote: |
Yes Its NUMVAL not NUMVALC |
I usually use NUMVAL-C also, it does the same as NUMVAL and also handles the occasional currency sign....... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
01 WS-TI-BENMR-AMT PIC -9(5).99.
|
the above elementary field item is alphanumeric. there should be no surprise that you can move x to x.
the OP wanted a conversion move alphanumeric (numbers, decimal point, sign) to a numeric field. you can do that with numval /numval-c. A straight move will result in a soc7. |
|
Back to top |
|
|
|