View previous topic :: View next topic
|
Author |
Message |
shankarm
Active User
Joined: 17 May 2010 Posts: 175 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
shankarm
Active User
Joined: 17 May 2010 Posts: 175 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
shankarm
Active User
Joined: 17 May 2010 Posts: 175 Location: India
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|