View previous topic :: View next topic
|
Author |
Message |
sachin.mandaliya
New User
Joined: 17 Jan 2007 Posts: 24 Location: India
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 . . . |
|
Back to top |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
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 |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
are you usning an array or table in your program. Even i had the same S0C4 problem recently. |
|
Back to top |
|
|
sachin.mandaliya
New User
Joined: 17 Jan 2007 Posts: 24 Location: India
|
|
|
|
I have executed program through Xpeditor and found that while initializing it got S0C4 |
|
Back to top |
|
|
sachin.mandaliya
New User
Joined: 17 Jan 2007 Posts: 24 Location: India
|
|
|
|
Also there is no array or table. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Is the file open before the initialize? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
What does the 01 for the FD look like? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
sachin.mandaliya
New User
Joined: 17 Jan 2007 Posts: 24 Location: India
|
|
|
|
FD entry just contains simple variables. and I have used INITIALISE verb for initializing. |
|
Back to top |
|
|
sachin.mandaliya
New User
Joined: 17 Jan 2007 Posts: 24 Location: India
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Craq Giegerich wrote: |
Is the file open before the initialize? |
Are you sure about this? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
sachin.mandaliya
New User
Joined: 17 Jan 2007 Posts: 24 Location: India
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
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. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
I have to agree with you. But (for me) the fact remains that by increasing the size of the file I got out of trouble. There were No changes to the program. I'll analyze more the next time I face this problem. Let me be happy till that time.. ;)
Thank you all for your comments! |
|
Back to top |
|
|
guy jax
New User
Joined: 05 Feb 2015 Posts: 2 Location: USA
|
|
|
|
Sachin,
I think that below is the reason of getting incorrect result...
Quote: |
What I have done is I have shifted my initialization of output record after first read of an input file. |
|
|
Back to top |
|
|
|