Page 1 of 1

How to resolve soc7?

Posted: Thu Nov 06, 2008 6:41 pm
by Lohith
Hi frnds,
I'm new to mainframe technology. I want to know the step by step method to resolve soc7 abend without using any tools(abend tools).
please guide me.


Posted: Thu Nov 06, 2008 7:55 pm
by dbzTHEdinosauer
start by looking at a cobol/asm/pl1 application programmers guide under the subject of debuging. not only will some things be explained, but links to other manuals will be given; the other manuals will go into depth about debugging.

You could also google, looking for 'how to resolve soc7'.

Posted: Fri Nov 07, 2008 10:41 am
by Lohith

SOC7 abend in COBOL S0C7

Posted: Fri Nov 07, 2008 1:12 pm
by Natarajan

here is some info which i have.

If you get S0C7 means some of your numeric variables/data items have invalid data. now we need to find out how to do this.

while compiling use compiler option LIST. it will give listing of your cobol program in spool.

Now, run your program, it will abend will with S0C7
go to spool and take the last four bytes of offset.

open the compiler listing and find those 4 bytes in the compiler listing.
you can find the position, where S0C7 occured.

In this way , we can find the position where S0C7 error got generated.

If you need any other help, let us know.

Posted: Wed Nov 12, 2008 1:50 pm
by Lohith
i got the offset address, but i could not find in which line it is showing abend.

SOC07 ABEND in COBOL program

Posted: Tue Nov 18, 2008 3:38 pm
by Natarajan
This example may help you.

step 1. check spool details of run job.
You will find a line similar to following.

Code: Select all

offset +00000AB6 at entry offset +00000AB6
copy last 4 bytes of offset i.e., copy 0AB6

step 2. go to spool details of compile job.
go to sysprint
find 0AB6
you can find the statement as shown in below example.

00345 MOVE
000SE0 5830 9134 L 3,308(0,9) BLF=0
000ER0 5840 9138 L 4,312(0,9) BLF=1
000AB6 F944 3000 4000 CP 0(5,3),0(5,4) NUMBER-X

Just few lines above the line, where you have found 4 digit offset number, you can find the cobol verb , that is where COBOL program abended with SOC7. In above example, cobol program abended with SOC7 at MOVE statement.

Let me know, if you still have questions on solveing SOC7 abend in COBOL program.

Posted: Sat Nov 22, 2008 7:22 am
by Anuj Dhawan

Do you have a product called Abend Aid?

Posted: Sat Nov 22, 2008 7:23 am
by Anuj Dhawan

The idea is to add the given displacement to the address given by the base register. And it is hexadecimal addition, so don't forget your base 16 math.

Then you scan down your dump to the given address and read the instruction, checking the contents of the fields. It really helps when you have a yellow IBM instruction card which shows the hexadecimal equivalents of the commands.

But even that won't help unless you know enough Assembler to realize that MVC is a Move Character command, and that the first field after the command is the RECEIVING field contents and the second is the sending field contents.

And unless your compile is done with the Assembler listing, that won't help much, because then you have to take the Assembler instruction back to your COBOL code to figure out what fields are being referenced by the abending command.

Posted: Sat Nov 22, 2008 7:34 am
by Anuj Dhawan
Hi again,

I hit enter little early ..let's continue from last post..

So how do you do this quickly and easily? You have to know what causes what errors - basically, you have to understand your data.

S0C7 is a data exception. This most commonly means that a numeric value has had something done to it that results in it being placed in an alphanumeric field. So start with your numeric fields. Pic 9(nn) fields are very forgiving, so start your research with your COMP fields (COMP, COMP-3, etc.).

Because you got a S0C7, I can safely assume this is a batch job and you are dealing with standard input files. Input files have copybook layouts. Look at the copybook. Find the "packed" (COMP) fields. Using the layout positions, use File-Aid to scan the file for non-numeric data in these fields.

File-Aid option 8 from the main menu allows you to get a file layout froma copybook. This tells you what position the particular field starts in and how long it is. Here is an example:

Code: Select all

                 09 DL-VAR-NUM01-05           PIC S9(05)V COMP-3. ... 
                 09 DL-VAR-NUM02-04           PIC S9(04)V COMP-3. ... 
                 09 DL-VAR-NUM03-03           PIC S9(03)V COMP-3. ... 
                 09 DL-VAR-CH01-01                    PIC X(01).  ... 
                 09 DL-VAR-CH02-18                    PIC X(18).  ... 

Here are three packed fields. I go to File-Aid F.8 to get the copybook layout and find where these fields are in the actual file:

Code: Select all

File-AID ---------------------- VIEW LAYOUT ------------ Row 24 to 44 of 1,850 
COMMAND ===>                                                  SCROLL ===> CSR  
Layout: MVD.ENVA.PANVALET(DLVAR512)                                            
      9 DL-VAR-DT05                   X(10)         20     53      62      10  
      9 DL-VAR-NUM01-05               S9(5)         21     63      65       3  
      9 DL-VAR-NUM02-04               S9(4)         22     66      68       3  
      9 DL-VAR-NUM03-03               S999          23     69      70       2  
      9 DL-VAR-CH01-01                X             24     71      71       1  

This tells me that I am looking for my first packed field to start in column 63 for a physical length of 3, ending in column 65. (63, 64, 65 makes three physical columns).

Then, again using File-Aid, I would look for nonnumeric values in these columns. Remember that characters are less than numbers in the mainframe world, so I can search any or all of these columns for data less than zero (for the purpose of this example, I took the liberty of using a different file):

Code: Select all

File-AID -------------  Unformatted Selection Criteria  ------ Row 1 to 1 of 1 
COMMAND ===>                                                  SCROLL ===> CSR  
Use END to continue, CANCEL to return to main screen.                          
Cmd /OR Position Length RO                      Data Value                      
--- --- -------- ------ -- ---------------------------------------------------- 
___      9       3      LT T'0'                                                
************************** END OF SELECTION CRITERIA ************************** 

And this gives me my offending record (or records, as the case may be).

Code: Select all

File-AID - Edit - MV603.NON.NUMERIC ----------------------------------------------------------------------------------------------- 
COMMAND ===>                                                                                                      SCROLL ===> CSR  
****** ******************************************************* TOP OF DATA **************** 
- - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 31 RECORD(S) NOT SELECTED 
000001 D5013290ABC531074057839092061C          E3C                                                                                  
- - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 44 RECORD(S) NOT SELECTED 
****** ****************************************************** BOTTOM OF DATA ********* 
Hope this helps..