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

S0c4 abend question


IBM Mainframe Forums -> ABENDS & Debugging
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Sun Mar 11, 2012 7:01 pm
Reply with quote

Hi am getting a s0c4 abend.
I tried recompiling the program with OFFSET option,
Code:

COB2 EXEC PGM=IGYCRCTL,PARM='OBJECT,NOTEST,OFFSET,DATA(24)',


Link with below parameters
Code:

LKED     EXEC PGM=IEWL,PARM='XREF,LIST,LET,MAP,AMODE=31,RMODE=ANY',


Abend message in sysout is,
Code:

offset +0000381E at entry offset +0000381E at address 15E03926.


When i search for '381E' in my compile program. it says search string not found.
My unserstanding was that, when a cobol program is compiled, it generates assembler code and it will have the offset address.

Am i doing something wrong? why am i not able to find '381E' in my compile job?

Please help.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Mar 11, 2012 7:08 pm
Reply with quote

Cobol code rarely translates one-to-one, so there will typically be many assembler instructions from one line of Cobol code.

When you have the offset, you have to find the source line whose offset is closest but less than the offset you are looking for.

If you generate the pseudo-assembler in the compile listing you will get an exact hit for the offset of the assembler generated, and it is the previous Cobol statement that the code has been generated from.
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Sun Mar 11, 2012 7:20 pm
Reply with quote

Bill,

The below lines of code is from the compile program,


Code:

000979 003778 IF                            000980 003782 WRITE 
000982 0038D8 ADD                           000984 0038F2 IF     
000986 003A0E ADD                           000988 003A28 IF     


The error offset is 381E in the above lines we have '3782 WRITE' which is closest but less than 381E.

so, The write operation could be the issue correct?

Pseudo-assembler is generated when 'LIST' option is used correct?
I have used list option but still there is no exact hit for '381E'

The compiler parm used is mentioned in my first post. Please correct me if i am wrong.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Mar 11, 2012 7:46 pm
Reply with quote

Yes, it is the code to do with the WRITE that has failed.

Are you saying you used LIST and didn't get the pseudo-assembler, or just didn't get a match to the offset?

If you have your LIST output, compare the code to the code around the location of the offset from the dump. Check what is being written, is the file open, stuff like that.

If you have the LIST and the code doesn't match, or the OFFSET is in the middle of an instruction, then you either have a problem with overwriting (start by looking to see if SSRANGE compile option is set) or you are not running the program you are looking at the compile listing of.
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Sun Mar 11, 2012 8:04 pm
Reply with quote

Thanks a lot Bill.

I am writing this below description about the issue for others to use in future,

I got a S0c4 abend and i got the offset address of the code throwing the error from sysout of my job.

i recompiled the program and searched for the offset address throm in sysout. I didn't get any match.

I changed the compiler option as below, with LIST

Code:

EXEC PGM=IGYCRCTL,PARM='OBJECT,NOTEST,LIST,DATA(24)'


and recompiled the program.

In the recompiled job, i searched for offset in SYSPRINT.


Code:

00381E  0E46                    MVCL 4,6       


I got the above match, the error is thrown in MVCL command.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Sun Mar 11, 2012 8:13 pm
Reply with quote

The OFFSET compiler option provides the offsets within the program for each COBOL verb. Since there may be multiple pseudo-assembler statements generated for each COBOL verb, as you have found the precise offset of an abend may be between the offsets of two COBOL verbs since it may occur on any pseudo-assembler instruction. The LIST compiler option will produce a pseudo-assembler listing of the entire program, so the exact offset of an abend can be located (in most cases); the cost is that the listing will be larger than if OFFSET is used.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Mar 11, 2012 8:48 pm
Reply with quote

Be careful when doing a re-compile. If you use a different option which affects the generated code (say, SSRANGE) the offset from the dump will no longer stand any chance of matching the listing, so the job will have to be run again to obtain the new dump with offset: which should then be in the listing.

Have a look here for a method to ensure you are looking at the same code from the run and the listing.
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 -> ABENDS & Debugging

 


Similar Topics
Topic Forum Replies
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Question for file manager IBM Tools 7
No new posts question for Pedro TSO/ISPF 2
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts WER999A - UNSUCCESSFUL SORT 8ED U Ab... SYNCSORT 5
Search our Forums:

Back to Top