Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Getting S0C4, while initializing record
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> FAQ & Off Topics
View previous topic :: :: View next topic  
Author Message
sachin.mandaliya

New User


Joined: 17 Jan 2007
Posts: 24
Location: India

PostPosted: Wed Apr 01, 2009 12:19 pm    Post subject: Getting S0C4, while initializing record
Reply with quote

Hi,

I have coded one program and I am getting S0C4 in program while initializing output file record.

Design of program is such that after opening the files I am initializing output file record with INITIALIZE verb and then all other processing is started.

Can you please help me for that?
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Apr 01, 2009 12:35 pm    Post subject: Re: Getting S0C4, while initializing record
Reply with quote

sachin.mandaliya wrote:
I have coded one program and I am getting S0C4 in program while initializing output file record.
How do you conclude this? S0C4 is Protection Exception . . . icon_confused.gif
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Wed Apr 01, 2009 12:36 pm    Post subject:
Reply with quote

can you please provide more info regarding the abend. below are the resaons for S0C4

Code:

    DESCRIPTION:  S0C4 - AN INVALID MACHINE ADDRESS WAS CALCULATED             
                  BY THE PROGRAM.                                               
                                                                               
PROBABLE CAUSES:   1. A SUBSCRIPT OR INDEX CONTAINED AN INVALID VALUE.         
                   2. A JCL DD STATEMENT WAS EITHER INVALID OR MISSING.         
                   3. THE BLOCKSIZE AND RECORD SIZE WERE SPECIFIED AS EQUAL     
                      FOR VARIABLE LENGTH RECORDS.                             
                   4. AN ATTEMPT WAS MADE TO READ/WRITE AN UNOPENED DATA SET.   
                   5. AN ATTEMPT WAS MADE TO READ AFTER END-OF-FILE.           
                   6. A STOP RUN OCCURRED:                                     
                      A. BEFORE ALL OPENED DATA SETS WERE CLOSED.               
                      B. IN THE INPUT OR OUTPUT PROCEDURE OF A SORT.           
                   7. AN ATTEMPT WAS MADE TO REFERENCE AN INPUT/OUTPUT AREA     
                      BUT NO OPEN OR READ HAD OCCURRED FOR THE DATA SET.       
                   8. INVALID PARAMETERS WERE PASSED THROUGH THE LINKAGE SECTION
                   9. THE FILE-CONTROL SELECT CLAUSE WAS MISSING               
                      FOR THE DATA SET THAT WAS BEING PROCESSED.
           
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Wed Apr 01, 2009 12:41 pm    Post subject:
Reply with quote

are you usning an array or table in your program. Even i had the same S0C4 problem recently.
Back to top
View user's profile Send private message
sachin.mandaliya

New User


Joined: 17 Jan 2007
Posts: 24
Location: India

PostPosted: Wed Apr 01, 2009 1:44 pm    Post subject: Reply to: Getting S0C4, while initializing record
Reply with quote

I have executed program through Xpeditor and found that while initializing it got S0C4
Back to top
View user's profile Send private message
sachin.mandaliya

New User


Joined: 17 Jan 2007
Posts: 24
Location: India

PostPosted: Wed Apr 01, 2009 1:47 pm    Post subject: Reply to: Getting S0C4, while initializing record
Reply with quote

Also there is no array or table.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Apr 01, 2009 3:44 pm    Post subject:
Reply with quote

Is the file open before the initialize?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Wed Apr 01, 2009 5:13 pm    Post subject:
Reply with quote

What does the 01 for the FD look like?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Wed Apr 01, 2009 8:13 pm    Post subject:
Reply with quote

Craq Giegerich wrote:
Is the file open before the initialize?

Do you initialize the area specified under the FD (in FILE SECTION) or an area in WORKING-STORAGE ??
Back to top
View user's profile Send private message
sachin.mandaliya

New User


Joined: 17 Jan 2007
Posts: 24
Location: India

PostPosted: Fri Apr 03, 2009 3:59 pm    Post subject: Reply to: Getting S0C4, while initializing record
Reply with quote

FD entry just contains simple variables. and I have used INITIALISE verb for initializing.
Back to top
View user's profile Send private message
sachin.mandaliya

New User


Joined: 17 Jan 2007
Posts: 24
Location: India

PostPosted: Fri Apr 03, 2009 4:05 pm    Post subject: Reply to: Getting S0C4, while initializing record
Reply with quote

Hi Everyone,

My problem is now resolved, but I don't know how is it resolved.

What I have done is I have shifted my initialization of output record after first read of an input file.

All other things are same, but now it is working fine.

I analysed code again but not able to get exact resolution. If anybody knows possible reason behind it then please do let me know.

Thank you all for you help.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2161
Location: @my desk

PostPosted: Fri Apr 03, 2009 4:09 pm    Post subject:
Reply with quote

Craq Giegerich wrote:
Is the file open before the initialize?
Are you sure about this?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Fri Apr 03, 2009 4:54 pm    Post subject:
Reply with quote

Quote:
If anybody knows possible reason behind it then please do let me know.
Since you've been asked a number of questions about the code and how you're doing the INITIALIZE, none of which you have answered, I suspect you're not going to get a lot of responses.
Back to top
View user's profile Send private message
sachin.mandaliya

New User


Joined: 17 Jan 2007
Posts: 24
Location: India

PostPosted: Fri Apr 03, 2009 5:05 pm    Post subject: Reply to: Getting S0C4, while initializing record
Reply with quote

Quote:
Are you sure about this?

Yes very sure....


Quote:
Since you've been asked a number of questions about the code and how you're doing the INITIALIZE, none of which you have answered, I suspect you're not going to get a lot of responses.

Robert, I think I have given all anwer to questions.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Fri Apr 03, 2009 5:52 pm    Post subject:
Reply with quote

Actually, you haven't posted any code from your program -- you've posted your answers, which are your interpretations of the code. Your interpretations may or may not be correct, which is why we ask to see the actual code, not your answers to the questions. So from the standpoint of answering the asked questions, you haven't provided a single thing for us to analyze. Technically you answered the questions but you did not answer them in a way that allows us to help you. Obviously, if your interpretations were correct you would not have had to ask for help here. When I asked what the 01 for the FD looked like, I wanted to see the actual 01 in BBCode format, not your answer of
Quote:
FD entry just contains simple variables. and I have used INITIALISE verb for initializing.
which does not tell us anything. For example, just what do you call a "simple variable"? PIC X? PIC 9? Edited alphanumeric? Edited numeric? National characters? Arrays without ODO? We have no way of telling without looking at the actual program code which you never provided. I repeat: so you never gave us the data we asked for.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Thu Jan 15, 2015 1:12 am    Post subject: Reply to: Getting S0C4, while initializing record
Reply with quote

Although It is an old post, I would like to share what happened with me. I was also getting a S0C4 at INITIALIZE statement and that is when I got to this thread.

The problem I saw, was with the output file size. When I increased the file size then the problem was resolved. It seems pretty obvious when you know the solution. icon_smile.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Thu Jan 15, 2015 5:21 am    Post subject: Reply to: Getting S0C4, while initializing record
Reply with quote

I don't think so, but if you're happy, what can we do?

A S0C4 you get by attempting to access storage you are not allowed to access. How would making the amount of storage you are attempting to access larger make that, in itself, go away?

As always, without seeing the relevant code, there's not much to go on...
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Thu Jan 15, 2015 9:34 am    Post subject: Reply to: Getting S0C4, while initializing record
Reply with quote

I believe it was because the program was writing about 3 million records in the output file but the file size was small to contain such large number of records. Hence by increasing the size we are able to fit those records in the file.
Does that sound right?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Jan 15, 2015 5:22 pm    Post subject:
Reply with quote

RahulG31: you apparently do not understand the difference between disk space and CPU memory. While the situation you described can cause ABENDs, it will not cause a S0C4 ABEND. The S0C4 occurs when a program attempts to access (read or write) memory in the CPU for which the program does not have access (because the memory location doesn't exist or is in use by another program or ... ). Not having space to write 3 million records would be a problem with disk space, not CPU memory.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Jan 15, 2015 6:51 pm    Post subject: Reply to: Getting S0C4, while initializing record
Reply with quote

The second word of the PSW (in the dump) will give you the address of the NSI (next sequential instruction). Note that the high-order bit of this address will most likely be 'on'. So, subtract X'80000000' from this address for the real address.

HTH....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> FAQ & Off Topics All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us