|
|
| Author |
Message |
rgarg
New User
Joined: 15 Feb 2006 Posts: 19
|
|
|
|
I am getting S0C4 abend during execution of my program. I can't be able to find out which cobol statement causes this abend. I know the bookish reason of S0C4. My shop do use the utility Abend aid but i don't know how to use it to solve S0C4. If someone can help me with that.
And if there is/are some good document on how to resolve S0C4 and how to use Abend Aid, then it would be very helpful to me. Thanks  |
|
| Back to top |
|
 |
References
|
|
 |
Jag
New User
Joined: 07 Dec 2005 Posts: 30
|
|
|
|
Hi ,
The SOC4 abend comes when the ouput dateset has utilized complete primary allocation and secondary allocation of space is not sepcified...
This S0C4 abend comes for the space problem and is issued by the OS,
To rectify inscrease the space of the output dataset
Cheers,
Jag. |
|
| Back to top |
|
 |
shivani_tech Warnings : 2 New User
Joined: 08 Jan 2006 Posts: 37 Location: delhi
|
|
|
|
hi jag
i think u r discussing sd37.r u sure of wat u have written here. |
|
| Back to top |
|
 |
Vinodc
New User
Joined: 01 Dec 2005 Posts: 38 Location: Prague
|
|
|
|
Hi Rgarg,
Is your program using a GDG base? (I mean all versions together of a GDG). If yes, is the first version of the GDG an empty file. If Yes, make the first version non-empty and rerun your program, you promise you wont get this S0C4.
If your answers was/were NO, then please update. Reason might be different and I might help with that too.
Vinod Chawda |
|
| Back to top |
|
 |
Bharanidharan
Active User
Joined: 20 Jun 2005 Posts: 100 Location: Chennai, India
|
|
|
|
Protection violation can occur due to many reasons. Do I assume that you are having the correct PSW value in dump? In that case, you can easily identify the problem causing statement (or instruction if you use assembler) - abend aid would list entry point as well as abending statement / instruction.
If you feel that address in PSW is not correct, things might be a bit difficult. There is still a way to find out the problem statement/instruction, but I would suggest using Xpeditor or any trace utility.
Please revert if this is not clear. |
|
| Back to top |
|
 |
prakash271082
Active User
Joined: 09 Sep 2005 Posts: 61
|
|
|
|
Hi,
As said by Bharani, it does occur due to many reasons. If you are not familiar with any of assising tools, the so called trial and error DISPLAY statement could be used to find out the abending statement.
Try to use DISPLAY statement before and after every statement suspected by you. But it would be tedious if your LOC is large. |
|
| Back to top |
|
 |
bandariv
New User
Joined: 11 Jul 2005 Posts: 1
|
|
| Back to top |
|
 |
priyesh.agrawal
Global Moderator
Joined: 28 Mar 2005 Posts: 1509 Location: Chicago, IL
|
|
|
|
rgarg,
S0C-4 basically denotes a Protection Exception.
Check if it is not a problem with SPACE ABEND, then you'll have to follow what Prakash pointed above.
Put some DISPLAYS in program to guide you up to the ERROR point, and then you can trace what is the root cause.
Regards,
Priyesh. |
|
| Back to top |
|
 |
sandhyaragav
New User
Joined: 05 Apr 2006 Posts: 15
|
|
|
|
Hi Rgarg,
S0C4 abend usually occurs when the program tries to access space that has not been allocated to it.
For example,
If your prg uses an array and your prog has a repetitive loop which does not have a proper termination condition or there is excess data that is populating the array. The reason in this case is overflow which causes your prog. to access space not allocated to it. Look this up.
Another reason could be that your program is not OPENing or CLOSEing the input and output files properly. Check this out.
Regards
Sandhya |
|
| Back to top |
|
 |
sudheer_kumar
New User
Joined: 27 Dec 2005 Posts: 18
|
|
|
|
SOC4 abends occur due to various reasons like -
a. A file not opened before a read or write is done on it.
b. Problem with the AMODE and RMODE difference. These differences can come when a AMODE 31 program is calling a AMODE 24 subroutine
(usually all Assembler sub routines run below line).
c. A VSAM file open error can also cause this abend some times. |
|
| Back to top |
|
 |
venktv
Active User
Joined: 29 Mar 2006 Posts: 54 Location: Bangalore
|
|
|
|
Hi Sandhya...
You are exactly correct, I too got the same abend for not declaring the array size sufficiently.....and also I got this abend for mismatch between the dataset record lengths decalred in the JCL and cobol program...
Thanks |
|
| Back to top |
|
 |
vishal_a
New User
Joined: 24 May 2005 Posts: 39 Location: Noida
|
|
|
|
Hi all ,
I agree with all .
Pls do also check about if you are using any Redefine clause than it should be valid other wise it will give SOC 4 as once i faced such situation
thanks |
|
| Back to top |
|
 |
Piyu
New User
Joined: 12 Apr 2006 Posts: 4 Location: Washington DC
|
|
|
|
If you know the s0c4 is because of some program error, do the following steps to trace.
1) Since you have abendaid installed, lookout at the DUMP/(some other step) provided by Abendaid for this job step. Here it will specify the cause and the offset number. (Sometimes depending on settings, Abendaid directly lets you know the statement number).
2)Now copy this offset number.
3) When you compiled your program before execution, you get the entire code listing which contains Map and Cross Reference in it for each statement. ( eg BLW=00000+0B0,0000000). Search for the offset number from step 2 in this program listing. Sometimes you will get the exact match. If not search for BLW nearby to your offset number as identified by Abendaid in step1.
5) I usually keep the program listing after compiling a program in own dataset so that it is simple to trace such errors instead of searching for the program listing.
Hope this helps. |
|
| Back to top |
|
 |
Virgon Warnings : 1 New User
Joined: 17 Jun 2005 Posts: 16 Location: Chennai
|
|
|
|
If I have the abend aid utility, this gives a trace of the module from the entry point to the abended module. Basically S0C4 occurs when your program try to access a storage and you dont have the reference(address) to it.
In COBOL programs, chances would occur during mainly for any I / O operations done to any module. so, first thing i will do would be suggested by Prakash.
Give displays before and after the modules which are called in the program.
Piyu,
Thats the exact method you would do when you have the protection exception if you know the module and that module is not any system reference module like DFH*, CEE* etc . Your explanation would be handy for data exception error. |
|
| Back to top |
|
 |
|
|