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

SOC7 Abend


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

PostPosted: Wed Apr 16, 2008 3:33 pm
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
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Apr 16, 2008 3:35 pm
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 N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Apr 16, 2008 3:44 pm
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
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

PostPosted: Wed Apr 16, 2008 3:44 pm
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
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

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

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

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

PostPosted: Wed Apr 16, 2008 4:15 pm
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: 2146
Location: At my coffee table

PostPosted: Wed Apr 16, 2008 8:09 pm
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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Apr 16, 2008 8:17 pm
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
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 ISAM and abend S03B JCL & VSAM 10
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts WER999A - UNSUCCESSFUL SORT 8ED U Ab... SYNCSORT 5
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
No new posts Need to get an DLI abend like U0200 IMS DB/DC 2
Search our Forums:

Back to Top