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

How to fix the soc7 abend in COBOL


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

New User


Joined: 03 Jan 2006
Posts: 5
Location: india

PostPosted: Fri Oct 26, 2007 11:16 pm
Reply with quote

Hi,

Can any one help me find out how to fix the soc7 abend...I m getting because of this.....
Code:

03  W10-DIST.                                               
      05  FILLER                                              PIC X(480).     
03  W10-DIST1 REDEFINES W10-DIST.                 
      05  W10-DIST11  OCCURS 20 TIMES.
            07  W10-ACCOUNT-4120                    PIC  X(10).     
            07  W10-CENTER-4120                       PIC  X(10).     
            07  W10-DISTRIB-PCT-4120                PIC S9(03)V9(04)   COMP-3.
03  W10-INVOICE-LINE-AMT-4110                   PIC S9(13)V99 COMP-3.


The data from the database is extracted until DB-END-OF-SET. As the databse had 21 occurances the invoice line amt field in the file was overwritten by the COMP-3 data.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Oct 26, 2007 11:54 pm
Reply with quote

bubu505 wrote:
Hi,

Can any one help me find out how to fix the soc7 abend...I m getting because of this.....
Code:

03  W10-DIST.                                               
      05  FILLER                                              PIC X(480).     
03  W10-DIST1 REDEFINES W10-DIST.                 
      05  W10-DIST11  OCCURS 20 TIMES.
            07  W10-ACCOUNT-4120                    PIC  X(10).     
            07  W10-CENTER-4120                       PIC  X(10).     
            07  W10-DISTRIB-PCT-4120                PIC S9(03)V9(04)   COMP-3.
03  W10-INVOICE-LINE-AMT-4110                   PIC S9(13)V99 COMP-3.


The data from the database is extracted until DB-END-OF-SET. As the databse had 21 occurances the invoice line amt field in the file was overwritten by the COMP-3 data.


Change the occurs 20 times to occurs 21 times or delete 1 item from the DB. You should be checking to make sure you don't exceed the table size.
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Fri Oct 26, 2007 11:55 pm
Reply with quote

I'm not a cobol programmer, but if you have 21 occurences of an invoice line amount and your are only defined to accept 20, wouldn't you need to add an additional occurance.

Code:

03  W10-DIST.                                               
      05  FILLER                                              PIC X(504).     
03  W10-DIST1 REDEFINES W10-DIST.                 
      05  W10-DIST11  OCCURS 21 TIMES.
            07  W10-ACCOUNT-4120                    PIC  X(10).     
            07  W10-CENTER-4120                       PIC  X(10).     
            07  W10-DISTRIB-PCT-4120                PIC S9(03)V9(04)   COMP-3.
03  W10-INVOICE-LINE-AMT-4110                   PIC S9(13)V99 COMP-3.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Oct 27, 2007 12:31 am
Reply with quote

Hello,

Quote:
The data from the database is extracted until DB-END-OF-SET
It would be a good idea to change the code to detect an "overrun" and react accordingly. You could read until e-o-s or when the limit has been reached. If the e-o-s has been reached, continue processing. If the limit has been reached, do whatever is needed - even a controlled termination with an appropriate message.

If you change the 20 to 21 and some time later have 22 entries, you will have another "ungraceful" abend. . .
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts ISAM and abend S03B JCL & VSAM 10
Search our Forums:

Back to Top