Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
SOC7 Abend

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
shrivatsa

Active User


Joined: 17 Mar 2006
Posts: 159
Location: Pune

PostPosted: Wed Apr 16, 2008 3:33 pm    Post subject: SOC7 Abend
Reply with quote

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
View user's profile Send private message
References
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1639
Location: germany

PostPosted: Wed Apr 16, 2008 3:35 pm    Post subject:
Reply with quote

compute WS-AN630-RECUR-REV1 = numvalc(WS-AN630-RECUR-REV)
end-compute
Back to top
View user's profile Send private message
Gnanas SNG

Senior Member


Joined: 06 Sep 2007
Posts: 442
Location: India

PostPosted: Wed Apr 16, 2008 3:44 pm    Post subject:
Reply with quote

Dick,
Code:
compute WS-AN630-RECUR-REV1 = numvalc(WS-AN630-RECUR-REV)


Is it NUMVAL?
Back to top
View user's profile Send private message
shrivatsa

Active User


Joined: 17 Mar 2006
Posts: 159
Location: Pune

PostPosted: Wed Apr 16, 2008 3:44 pm    Post subject:
Reply with quote

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
View user's profile Send private message
shrivatsa

Active User


Joined: 17 Mar 2006
Posts: 159
Location: Pune

PostPosted: Wed Apr 16, 2008 3:45 pm    Post subject:
Reply with quote

Yes Its NUMVAL not NUMVALC
Back to top
View user's profile Send private message
shrivatsa

Active User


Joined: 17 Mar 2006
Posts: 159
Location: Pune

PostPosted: Wed Apr 16, 2008 4:15 pm    Post subject:
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 1199
Location: At my desk

PostPosted: Wed Apr 16, 2008 8:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1639
Location: germany

PostPosted: Wed Apr 16, 2008 8:17 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1