Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

S0C9 Error fixed-point divide exception
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
saji123

New User


Joined: 15 Jul 2009
Posts: 19
Location: Chennai

PostPosted: Mon Sep 07, 2009 1:53 pm    Post subject: S0C9 Error fixed-point divide exception
Reply with quote

Hi
I am getting Abend S0C9 while submitting the JCl error is shown as
The system detected a fixed-point divide exception (System Completion
Code=0C9).

But I havn't used and Division in my Code. Can anyone tell mw what other reason will be there for this error..
Back to top
View user's profile Send private message

Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Mon Sep 07, 2009 2:06 pm    Post subject:
Reply with quote

Hi,
while trying to edit or browse a PS dataset with LRECL 0 the File Manager abends with S0C9 check the LREC of the file
Back to top
View user's profile Send private message
saji123

New User


Joined: 15 Jul 2009
Posts: 19
Location: Chennai

PostPosted: Mon Sep 07, 2009 4:00 pm    Post subject:
Reply with quote

LRECL is also fine. I am moving a COMP value to non-COMP value and doing calculation on this variable. Will it cause an error. i have declared both the COMP value and the non-COMP value with the same size.
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Mon Sep 07, 2009 4:02 pm    Post subject:
Reply with quote

It won't give you a SOC9 for this reason.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Mon Sep 07, 2009 6:52 pm    Post subject:
Reply with quote

Quote:
I am moving a COMP value to non-COMP value and doing calculation on this variable. Will it cause an error. i have declared both the COMP value and the non-COMP value with the same size.
Of course it can -- it does not matter whether the fields are COMP or not, it does not matter the PIC clause for the fields -- if you say DIVIDE A BY B and you have not verified that B is not zero, you can get an S0C9 abend. The most common reason for S0C9 is divide by zero.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Mon Sep 07, 2009 7:09 pm    Post subject:
Reply with quote

saji123,
It would help if you posted (copy/paste from your program) the field definitions and all relevant code and error messages involved.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Sep 07, 2009 7:18 pm    Post subject:
Reply with quote

Hi Saji,

It would also be nice to know what COBOL stmt caused the Abend. Have you done that?

If not, do a search of the posts here using "OFFSET" or "0C7" to find how to do it.
Back to top
View user's profile Send private message
saji123

New User


Joined: 15 Jul 2009
Posts: 19
Location: Chennai

PostPosted: Mon Sep 07, 2009 7:26 pm    Post subject:
Reply with quote

the piece of code where i am getting error is
MOVE W040-EQRFND-CREDITAMT (W040-EQRFND-SUB)
TO WS-EQRFND-CRAMT-TEMP


I have declared field as W040-EQRFND-CREDITAMT PIC s9(16) comp.
WS-EQRFND-CRAMT-TEMP PIC s9(16) value 0.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Mon Sep 07, 2009 7:31 pm    Post subject:
Reply with quote

Please post what is requested. And copy/paste what you post directly from your program instead of keying it. Your source field in the MOVE statement is subscripted/indexed but you didn't post the definition of the subscript (if subscripted) or the value of it.
Back to top
View user's profile Send private message
saji123

New User


Joined: 15 Jul 2009
Posts: 19
Location: Chennai

PostPosted: Mon Sep 07, 2009 7:42 pm    Post subject:
Reply with quote

Oh Sorry !!

01 WS-EQRFND-CREDITAMT PIC S9(9)V99 VALUE 0.
01 WS-EQRF-CREDITAMT PIC S9(15)V999 VALUE 0.
01 WS-EQRFND-CRAMT-TEMP1 PIC S9(9)V99 VALUE 0.
01 WS-EQRFND-CRAMT-TEMP2 PIC S9(9)V99 VALUE 0.
01 WS-EQRFND-CRAMT-TEMP PIC S9(15)V999 VALUE 0.

01 W040-EQRFND-TABLE PIC X(870000) VALUE HIGH-VALUES.
01 FILLER REDEFINES W040-EQRFND-TABLE.
03 W040-EQRFND-ENTRIES OCCURS 10000
ASCENDING KEY
W040-EQRFND-CUSNO
INDEXED BY W040-EQRFND-SUB.
05 W040-EQRFND-CREDITAMT PIC S9(9)V99 COMP.


MOVE W040-EQRFND-CREDITAMT (W040-EQRFND-SUB)
TO WS-EQRFND-CRAMT-TEMP1



Error Message: The system detected a fixed-point divide exception (System Completion
Code=0C9).
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Mon Sep 07, 2009 8:07 pm    Post subject:
Reply with quote

Please post what is requested. What is the value of W040-EQRFND-SUB immediately before the MOVE statement is executed (you can DISPLAY it). And please use BBCode to make your post more readable.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Mon Sep 07, 2009 8:08 pm    Post subject:
Reply with quote

Where's your SET statement for W040-EQRFND-SUB? You want us to figure out an index error without telling us how you set the index?
Back to top
View user's profile Send private message
saji123

New User


Joined: 15 Jul 2009
Posts: 19
Location: Chennai

PostPosted: Mon Sep 07, 2009 8:12 pm    Post subject:
Reply with quote

SET W040-EQRFND-SUB TO 1

MOVE W040-EQRFND-ADVNO (W040-EQRFND-SUB)
TO WS-PREV-ADVNO
MOVE W040-EQRFND-CREDITAMT (W040-EQRFND-SUB)
TO WS-EQRFND-CRAMT-TEMP1
SET W040-EQRFND-SUB UP BY 1
MOVE W040-EQRFND-ADVNO (W040-EQRFND-SUB)
TO WS-CURRENT-ADVNO
PERFORM UNTIL WS-CURRENT-ADVNO NOT = WS-PREV-ADVNO
MOVE W040-EQRFND-CREDITAMT (W040-EQRFND-SUB)
TO WS-EQRFND-CRAMT-TEMP2
ADD WS-EQRFND-CRAMT-TEMP2 TO WS-EQRFND-CRAMT-TEMP1
MOVE W040-EQRFND-ADVNO (W040-EQRFND-SUB)
TO WS-PREV-ADVNO
SET W040-EQRFND-SUB UP BY 1
MOVE W040-EQRFND-ADVNO (W040-EQRFND-SUB)
TO WS-CURRENT-ADVNO
END-PERFORM



Now am getting error in the ADD statement. icon_sad.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Sep 07, 2009 8:34 pm    Post subject:
Reply with quote

Did you notice what Robert has pointed to in his first post? Dividing by zero is the most common cause of this ABEND. Correct the program logic error that caused the divide exception and resubmit the job.

This ABEND is caused by a fixed-point divide exception. A quotient has exceeded the register size in a DIVIDE instruction, or the result of a CONVERT TO BINARY instruction is more than 31 bits long. Don't you have any divide-by instruction in your code at all?
Back to top
View user's profile Send private message
saji123

New User


Joined: 15 Jul 2009
Posts: 19
Location: Chennai

PostPosted: Mon Sep 07, 2009 8:37 pm    Post subject:
Reply with quote

No i dont have any Divide by instruction in my code
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Mon Sep 07, 2009 8:46 pm    Post subject:
Reply with quote

Recompile your code with NOOFF,LIST to get the pseudo-assembler listing. Once this is done, rerun the program and the offset for the abend should point to one of the pseudo-assembler instructions. Post the exact error message and pseudo-assembler code (5 instructions before and after the line with the error should be enough). And use the BBcode for your listing to make it easier to review.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Mon Sep 07, 2009 9:13 pm    Post subject:
Reply with quote

Quote:
Now am getting error in the ADD statement
This statement tells us next to nothing. What exactly is the error? Did you not see my request to include all relevant error messages and to use BBCode. Are you pasting your posts directly from your program or keying it in manually?
Back to top
View user's profile Send private message
saji123

New User


Joined: 15 Jul 2009
Posts: 19
Location: Chennai

PostPosted: Mon Sep 07, 2009 9:32 pm    Post subject:
Reply with quote

I am pasting the code directly from the program. I got error in the ADD statement since i declared the variable as COMP. I have changed my Code a little.

My exact code is like
Code:
01 WS-CASINFC-REV-FIXCHG        PIC S9(15)V999 COMP VALUE 0.
01 WS-EQRFND-CREDITAMT          PIC S9(9)V99   COMP VALUE 0.
01 WS-EQRF-CREDITAMT            PIC S9(15)V999 COMP VALUE 0.
01 WS-EQRFND-CRAMT-TEMP1        PIC S9(9)V99   COMP VALUE 0.
01 WS-EQRFND-CRAMT-TEMP2        PIC S9(9)V99   COMP VALUE 0.
01 WS-EQRFND-CRAMT-TEMP         PIC S9(15)V999 COMP VALUE 0.
01 WS-VATAMT                    PIC S9(9)V99   COMP VALUE 0.


/ internal tables.
Code:
 01 W040-EQRFND-TABLE            PIC X(870000) VALUE HIGH-VALUES.
 01 FILLER REDEFINES W040-EQRFND-TABLE.
    03  W040-EQRFND-ENTRIES   OCCURS 10000
                              ASCENDING KEY
                               W040-EQRFND-CUSNO
                            INDEXED BY W040-EQRFND-SUB.
        05 W040-EQRFND-CUSNO            PIC X(7).
        05 W040-EQRFND-CREDIT-REF       PIC X(8).
        05 W040-EQRFND-TRANSDTE         PIC S9(9)    COMP.
        05 W040-EQRFND-TOTAMT           PIC S9(9)V99 COMP.
        05 W040-EQRFND-EQUCDE           PIC X(4).
        05 W040-EQRFND-EQUDESC          PIC X(25).
        05 W040-EQRFND-VATCDE           PIC X.
        05 W040-EQRFND-INVOICE-BILDTE   PIC S9(9)    COMP.
        05 W040-EQRFND-INVOICE-ID       PIC X(8).
        05 W040-EQRFND-CREDITAMT        PIC S9(9)V99 COMP.


SET W040-EQRFND-SUB TO 1
MOVE W040-EQRFND-CREDITAMT (W040-EQRFND-SUB)
                 TO WS-EQRFND-CRAMT-TEMP1
SET W040-EQRFND-SUB UP BY 1
PERFORM UNTIL WS-CURRENT-ADVNO NOT = WS-PREV-ADVNO
  MOVE W040-EQRFND-CREDITAMT (W040-EQRFND-SUB)
            TO WS-EQRFND-CRAMT-TEMP2
  COMPUTE WS-EQRFND-CRAMT-TEMP1 =
      WS-EQRFND-CRAMT-TEMP1 + WS-EQRFND-CRAMT-TEMP2
   MOVE W040-EQRFND-ADVNO  (W040-EQRFND-SUB)
             TO WS-PREV-ADVNO
   SET W040-EQRFND-SUB UP BY 1
   MOVE W040-EQRFND-ADVNO  (W040-EQRFND-SUB)
            TO WS-CURRENT-ADVNO
 END-PERFORM
 MOVE WS-EQRFND-CRAMT-TEMP1 TO WS-EQRFND-CRAMT-TEMP
IF WS-EQRFND-CRAMT-TEMP = W040-CASINFC-REV-FIXCHG
                       (W040-CASINFC-SUB)
PERFORM X0615-GET-LINE-ITEM



The error i am getting is
The system detected a fixed-point divide exception (System Completion
Code=0C9).

From compile unit YLG94A at entry point YLG94A at compile unit offset
+00001B3E at entry offset +00001B3E at address 21602376.

When i checked for 1B3E it is like


Code:
000745  COMPUTE
   001B2A  9823 82F8          LM    2,3,760(8)    WS-EQRFND-CRAMT-TEMP1
   001B2E  5A20 8300          A     2,768(0,8)    WS-EQRFND-CRAMT-TEMP2
   001B32  5E30 8304          AL    3,772(0,8)    WS-EQRFND-CRAMT-                                                                                              TEMP2+4
   001B36  47C0 B80E          BC    12,2062(0,11) GN=156(001B3E)
   001B3A  5A20 C00C          A     2,12(0,12)    SYSLIT AT +12
   001B3E            GN=156   EQU   *
   001B3E  5D20 C008          D     2,8(0,12)     SYSLIT AT +8
   001B42  4E30 D288          CVD   3,648(0,13)   TS2=16
   001B46  F154 D278 D28B     MVO   632(6,13),651(5,13)  TS2=0
   001B4C  4E20 D288          CVD   2,648(0,13)   TS2=16
   001B50  9110 D27D          TM    637(13),X'10' TS2=5

Edited for BBcode
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Mon Sep 07, 2009 9:47 pm    Post subject:
Reply with quote

And what do we see at 1B3E? A Divide pseudo-assembler instruction. If you got a dump from the abend, look in the TGT to find the SYSLIT address and figure out what is at offset 8. Somehow that value is becoming zero -- possibly due to table overflow.

If you haven't compiled with SSRANGE, do so and run with the run time option to turn on subscript range checking.
Back to top
View user's profile Send private message
saji123

New User


Joined: 15 Jul 2009
Posts: 19
Location: Chennai

PostPosted: Wed Sep 09, 2009 3:55 pm    Post subject:
Reply with quote

Hi ,
Thank you for all your support i got the solved the error.
I was problem with the input file
Thanks
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Error during restore rename archanamuthukrishnan All Other Mainframe Topics 2 Fri Oct 14, 2016 3:30 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us