View previous topic :: View next topic
|
Author |
Message |
bubu505 Warnings : 1 New User
Joined: 03 Jan 2006 Posts: 5 Location: india
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
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 |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|