How to resolve soc7?

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
Lohith
Member
Posts: 3
Joined: Thu Nov 06, 2008 9:08 am

How to resolve soc7?

Post by Lohith » Thu Nov 06, 2008 6:41 pm

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.

thanks,
lohit

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Thu Nov 06, 2008 7:55 pm

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'.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Lohith
Member
Posts: 3
Joined: Thu Nov 06, 2008 9:08 am

Post by Lohith » Fri Nov 07, 2008 10:41 am

thanks.............

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

SOC7 abend in COBOL S0C7

Post by Natarajan » Fri Nov 07, 2008 1:12 pm

Lohith,

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.
Last edited by Natarajan on Mon Aug 03, 2009 9:13 pm, edited 2 times in total.
Natarajan
Chennai

Lohith
Member
Posts: 3
Joined: Thu Nov 06, 2008 9:08 am

Post by Lohith » Wed Nov 12, 2008 1:50 pm

natarajan,
i got the offset address, but i could not find in which line it is showing abend.

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

SOC07 ABEND in COBOL program

Post by Natarajan » Tue Nov 18, 2008 3:38 pm

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.
Natarajan
Chennai

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Sat Nov 22, 2008 7:22 am

Hi,

Do you have a product called Abend Aid?
Regards,
Anuj

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

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

Hi,

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.
Last edited by Anuj Dhawan on Thu Nov 03, 2011 12:58 pm, edited 1 time in total.
Regards,
Anuj

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Sat Nov 22, 2008 7:34 am

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)                                            
                                                 FIELD                          
--------- FIELD LEVEL/NAME ---------- -PICTURE- -NUMBER START     END  LENGTH  
      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.                          
                                                                                
    AND                                                                        
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  
       ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0- 
****** ******************************************************* TOP OF DATA **************** 
- - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 31 RECORD(S) NOT SELECTED 
000001 D5013290ABC531074057839092061C          E3C                                                                                  
- - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 44 RECORD(S) NOT SELECTED 
****** ****************************************************** BOTTOM OF DATA ********* 
Hope this helps..
Regards,
Anuj

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others