View previous topic :: View next topic |
Author |
Message |
rsantosh Beginner
Joined: 20 Dec 2014 Posts: 38 Topics: 9
|
Posted: Fri Aug 10, 2018 6:36 am Post subject: S0C7 in ADD 1 statement |
|
|
Hello,
We have a COBOL program with following variable definition
Code: | 05 OUT2-COUNT PIC 9(00009) VALUE ZERO. |
This program reads an input file and after writing the record to an output file increments the OUT2-COUNT. This statement resulted in S0C7.
Code: |
WRITE FILEO002-RECORD FROM OUT2-RECORD
ADD 1 TO OUT2-COUNT. |
The code was compiled with TEST compiler option which gave the statement number causing the S0C7.
Some more information.
1. Input file is FB LRECL 32760
2. Three WS storage variable defined as PIC X(32760)
As a temporary fix we changed the definition of OUT2-COUNT to PIC 9(5) COMP.
I am not able to figure out why a simple ADD statement is causing the abend? Please note the abend doesnt occur at very first instance of the ADD statement. It occurs after writing some 30000 records. |
|
Back to top |
|
|
rsantosh Beginner
Joined: 20 Dec 2014 Posts: 38 Topics: 9
|
Posted: Fri Aug 10, 2018 6:44 am Post subject: |
|
|
Additional info. Program runs daily and this is the first time it failed with S0C7. No changes done in program since April-2018.
Regards,
Santosh |
|
Back to top |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Fri Aug 10, 2018 8:34 am Post subject: |
|
|
OUT2-COUNT is an elementary item. What is the group item it belongs to and does it get modified before you ADD 1 TO OUT2-COUNT? You could redefine OUT2-COUNT as PIC X(9) and prior to ADDing, insert the following: Code: | IF OUT2-COUNT NOT NUMERIC
DISPLAY 'OUT2-COUNT-REDEFINED: >' OUT2-COUNT-REDEFINED '<'
END-IF | then go to your SYSOUT and display the output in hex. _________________ ....Terry |
|
Back to top |
|
|
rsantosh Beginner
Joined: 20 Dec 2014 Posts: 38 Topics: 9
|
Posted: Fri Aug 10, 2018 8:53 am Post subject: |
|
|
Hello Terry,
OUT2-COUNT is part of a group variable which contains all the temporary variables which gets changed/initialized for every record of the input file. Also, it contains two elementary items with length 32760.
Code: |
01 WS-VARIABLES.
05 WS-AFTER PIC 9(00004) VALUE ZERO.
05 WS-BEFORE PIC 9(00004) VALUE ZERO.
05 WS-IN-POS PIC 9(00006) VALUE ZERO.
05 WS-LEN PIC 9(00003) VALUE ZERO.
05 WS-VAR1 PIC X(32760) VALUE SPACES.
05 WS-VAR2 PIC X(32760) VALUE SPACES.
05 WS-VAR3 PIC 9(00006) VALUE ZERO.
05 WS-VAR4 PIC 9(00006) VALUE ZERO.
05 WS-VAR5 PIC X(00100) VALUE SPACES.
05 WS-ON-FLAG PIC 9(00001) VALUE ZERO.
88 WS-FLAG1 VALUE 1.
88 WS-FLAG2 VALUE 2.
05 WS-VAR6 PIC X(00009).
05 WS-VAR7 PIC S9(00003) COMP.
05 WS-COUNT PIC 9(00006) VALUE ZERO.
05 WS-INSPECT-LENGTH PIC 9(00006) VALUE ZERO.
05 WS-NEW-COUNT PIC 9(00006) VALUE ZERO.
05 WS-TEST-COUNT PIC 9(00006) VALUE ZERO.
05 WS-COUNT1 PIC 9(00006) VALUE ZERO.
05 INPUT-COUNT-1 PIC 9(00009) VALUE ZERO.
05 READ-COUNT PIC 9(00009) VALUE ZERO.
05 DATA-COUNT PIC 9(00009) VALUE ZERO.
05 OUT2-COUNT PIC 9(00009) VALUE ZERO.
05 OUT3-COUNT PIC 9(00009) VALUE ZERO.
05 WS-LOAD-TYPE PIC X(00005) VALUE SPACES.
05 WS-VAR8 PIC X(00009) VALUE SPACES.
05 WS-VAR9 PIC X(00075) VALUE SPACES.
|
CEEDUMP shows the value OUT2-COUNT had during abend.It has X'F0F0F0F0F3F46EF3F7'
Code: |
364 02 DATA-COUNT 9(9) DISP 000025203
365 02 OUT2-COUNT 9(9) DISP 000034>37
366 02 OUT3-COUNT 9(9) DISP 000025203
|
Regards,
Santosh |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Aug 10, 2018 9:02 am Post subject: |
|
|
As you can see, something has clobbered your OUT2-COUNT. You need to find out what. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
rsantosh Beginner
Joined: 20 Dec 2014 Posts: 38 Topics: 9
|
Posted: Fri Aug 10, 2018 9:07 am Post subject: |
|
|
Yes, that's what I was thinking but looking for a lead/clue. How to proceed? Since it fails after running for 30 mins.
What can cause the corruption of that variable?
Santosh |
|
Back to top |
|
|
rsantosh Beginner
Joined: 20 Dec 2014 Posts: 38 Topics: 9
|
Posted: Fri Aug 10, 2018 11:15 am Post subject: |
|
|
Update:
Below statement was the culprit.
Code: |
MOVE WS-IN-RECORD (WS-IN-POS:1)
TO WS-VAR-TAG (WS-VAR-TAG-POS:1)
|
Code: | WS-VAR-TAG defined as PIC X(100) | but WS-VAR-TAG-POS contained 176 which caused the corruption of variable that followed. |
|
Back to top |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Fri Aug 10, 2018 12:53 pm Post subject: |
|
|
You need to determine what the values of WS-IN-POS and WS-VAR-TAG-POS were at the time that MOVE statement was executed. Somehow, a greater than character (X'6E') got moved into position 7 of OUT2-COUNT. My guess is that before your culprit MOVE happened, the value of OUT2-COUNT was somewhere between 34037 and 34937. _________________ ....Terry |
|
Back to top |
|
|
|
|