Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
S0C4 Abend

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
Author Message
rgarg

New User


Joined: 15 Feb 2006
Posts: 19

PostPosted: Sat Apr 08, 2006 3:45 pm    Post subject: S0C4 Abend
Reply with quote

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 icon_biggrin.gif
Back to top
View user's profile Send private message
References
Jag

New User


Joined: 07 Dec 2005
Posts: 30

PostPosted: Sat Apr 08, 2006 4:45 pm    Post subject: Hi
Reply with quote

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
View user's profile Send private message
shivani_tech
Warnings : 2

New User


Joined: 08 Jan 2006
Posts: 37
Location: delhi

PostPosted: Sun Apr 09, 2006 7:38 pm    Post subject:
Reply with quote

hi jag
i think u r discussing sd37.r u sure of wat u have written here.
Back to top
View user's profile Send private message
Vinodc

New User


Joined: 01 Dec 2005
Posts: 38
Location: Prague

PostPosted: Mon Apr 10, 2006 3:38 am    Post subject: S0C4 Abend
Reply with quote

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
View user's profile Send private message
Bharanidharan

Active User


Joined: 20 Jun 2005
Posts: 100
Location: Chennai, India

PostPosted: Mon Apr 10, 2006 9:03 am    Post subject: Re: S0C4 Abend
Reply with quote

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
View user's profile Send private message
prakash271082

Active User


Joined: 09 Sep 2005
Posts: 61

PostPosted: Mon Apr 10, 2006 11:54 am    Post subject:
Reply with quote

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
View user's profile Send private message
bandariv

New User


Joined: 11 Jul 2005
Posts: 1

PostPosted: Mon Apr 10, 2006 12:04 pm    Post subject:
Reply with quote

icon_neutral.gif icon_cry.gif
Back to top
View user's profile Send private message
priyesh.agrawal

Global Moderator


Joined: 28 Mar 2005
Posts: 1509
Location: Chicago, IL

PostPosted: Mon Apr 10, 2006 12:27 pm    Post subject: Re: S0C4 Abend
Reply with quote

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
View user's profile Send private message
sandhyaragav

New User


Joined: 05 Apr 2006
Posts: 15

PostPosted: Mon Apr 10, 2006 3:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
sudheer_kumar

New User


Joined: 27 Dec 2005
Posts: 18

PostPosted: Mon Apr 10, 2006 4:51 pm    Post subject:
Reply with quote

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
View user's profile Send private message
venktv

Active User


Joined: 29 Mar 2006
Posts: 54
Location: Bangalore

PostPosted: Mon Apr 10, 2006 5:04 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vishal_a

New User


Joined: 24 May 2005
Posts: 39
Location: Noida

PostPosted: Tue Apr 18, 2006 11:07 pm    Post subject: SOC 4
Reply with quote

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
View user's profile Send private message
Piyu

New User


Joined: 12 Apr 2006
Posts: 4
Location: Washington DC

PostPosted: Wed Apr 19, 2006 9:41 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Virgon
Warnings : 1

New User


Joined: 17 Jun 2005
Posts: 16
Location: Chennai

PostPosted: Tue Apr 25, 2006 6:12 am    Post subject:
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1