IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Help needed to fix S0C7 abend


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Fri Oct 12, 2007 9:21 am
Reply with quote

Hi,

I am getting S0C7 abend and trying for hours to fix it. can someone please let me know how to find the variable causing teh error using the offset in teh abend report. Any help would be greatly appreciated.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Oct 12, 2007 9:27 am
Reply with quote

Please refer this Link
See the post by Jack (mmwife)
Back to top
View user's profile Send private message
nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Fri Oct 12, 2007 9:42 am
Reply with quote

Take the offset where you got the error. Go to program listing and find this offset, then you will get the line number causing the abend. Chenck the line program to find the variable for this abend. First check whether all of your data is properly initialized or not.
Back to top
View user's profile Send private message
hemanth.nandas

Active User


Joined: 18 Aug 2007
Posts: 120
Location: India

PostPosted: Fri Oct 12, 2007 10:25 am
Reply with quote

HI Satyaraj,

Welcome To Forum..

Quote:
S0C7 abend and trying for hours to fix it


There are more reason which cuases this abend.
Check All the possibilities.
1) Working-storage INTIALIZATION
2) Moving Non-Numeric item to Numeric item (Bad Data)
3) Out of Index
4) etc.

To Check all this and Debugg the same,

1. Use SYSUDUMP in your JCL,
2. Take the Offset of the variable Where you had got ERROR,
3. Match for the same in PROGRAM LISTING, Get the line Number, Then Locate For the same which directs you to the command/variable.

Which Version control are you using?

If Endevor, Go To Foot Print Listing, Find Offset, Which gives Command as well Line number.

Then Fix It.

Anyhow, If it Doesn't work out, Then Post your problem Very clearly, I mean under Which environmemt(contorl version) you are running this?
Back to top
View user's profile Send private message
hemanth.nandas

Active User


Joined: 18 Aug 2007
Posts: 120
Location: India

PostPosted: Fri Oct 12, 2007 10:28 am
Reply with quote

Hi Moderator,

Please Change Code to Quote
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Fri Oct 12, 2007 2:19 pm
Reply with quote

Thnx every one for your support.

I am passing a numeric data from a table variable to a vsam file key feild. Then I am trying to read the records in the file for the corresponding feilds. Even the key feild is numeric so I dont know where the actual problem is. How can i go with this..?
Back to top
View user's profile Send private message
nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Fri Oct 12, 2007 2:22 pm
Reply with quote

Use DISPLAY statement to diaplay ur variable which you have received from table and check whether its the valid numeric vlaue or not.
Back to top
View user's profile Send private message
hemanth.nandas

Active User


Joined: 18 Aug 2007
Posts: 120
Location: India

PostPosted: Fri Oct 12, 2007 2:39 pm
Reply with quote

Hi Satyaraj,

Quote:
I am passing a numeric data from a table variable to a vsam file key feild. Then I am trying to read the records in the file for the corresponding feilds


Explain it clearly, I mean Which file you are reading again for corresponding field?

Whats content of Table value? Had you checked it? Are you intialized Host Variables and VSAM Key field variables? Are you usiong Index?

Post your problem with little more explaination? Also Follow as Nuthan said.
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Fri Oct 12, 2007 3:13 pm
Reply with quote

@ nuthan

I checked the table variable its numeric.

@ hemanth

Lets pressume that the table has the list of department codes. the VSAM file has data for which dep code is the key. I want only the data for the Dep codes in the table. The working variables and teh key feilds are initialised. I am calling a separate program to initialise the VSAM file using a copy book.

Thnx both of you for the support. please let me know if you need more clarity in this.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Oct 12, 2007 3:19 pm
Reply with quote

Sathya
Ok. We know that variable is numeric. We are saying that content of it is NOT. (Thats why you get S0C7)

From your posts I can see that you havent really found the offending variable. If you could atleast post your code then we may be able to help. (Just the relavent portion).
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Fri Oct 12, 2007 3:35 pm
Reply with quote

my input file declaration

FD CUST-FILE
LABEL RECORDS ARE STANDARD
RECORDING MODE IS F
BLOCK CONTAINS 0 RECORDS
RECORD CONTAINS 80 CHARACTERS
DATA RECORD IS CUST-INPUT-RECORD.

01 CUST-INPUT-RECORD.
05 CUST-NUM PIC 9(07).
05 CUST-IP PIC 9(01).
05 FILLER PIC X(72).



Table declaration

01 WS-PLAN-TABLE.
05 WS-HOLD-TABLE-RECORD OCCURS 2000 TIMES.
10 WS-CUST-NO PIC 9(07) VALUE ZEROES.
10 WS-CUST-IP PIC 9(01) VALUE ZEROES.

Passing the table variable to the key


MOVE LOW-VALUES TO ORG-CES-32-BYTE-KEY
MOVE WS-CUST-NO(SUB-TAB) TO ORG-CES-KEY-CUSTOMER-NUMBER
PERFORM 5100-READ-INFORCE
THRU 5100-EXIT.

The reading part

*------------------*
5100-READ-INFORCE.
*------------------*

MOVE K-READ-NEXT TO USG-REQUEST-CODE
CALL USG-INFORCE-IO-PGM USING
STANDARD-CES-USING-AREA
ORIG-CES-AREA
NEW-CES-AREA
ORIG-JOBCNTRL-AREA.


IF RETURN-IO-SUCCESSFUL-IN-USG
THEN
ADD K-1 TO CTR-INF-RECORD-COUNT
IF ORG-CES-KEY-CUSTOMER-NUMBER NOT EQUAL
WS-CUST-NO(SUB-TAB)
THEN
MOVE SW-ON TO SW-EOF
END-IF
ELSE
IF RETURN-END-OF-FILE-IN-USG
OR RETURN-RECORD-NOT-FOUND-IN-USG
THEN
MOVE SW-ON TO SW-EOF

Please let me know if you need anything else..
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Oct 12, 2007 3:48 pm
Reply with quote

Did you follow my first post in this thread and found out the offending line?
I don't think you did.

I assume that you are sure that you are getting abend in one of the instructions posted above.
Now add display statements in the program above to display all the variables used in below code.

ADD K-1 TO CTR-INF-RECORD-COUNT

IF ORG-CES-KEY-CUSTOMER-NUMBER NOT EQUAL
WS-CUST-NO(SUB-TAB)
You get S0C7 when you try to do arithmatic operation on Non numeric data.
One more question why are moving low values in ORG-CES-32-BYTE-KEY ?
Back to top
View user's profile Send private message
Earl

Active User


Joined: 17 Jun 2007
Posts: 148
Location: oklahoma

PostPosted: Mon Oct 15, 2007 3:48 am
Reply with quote

moving low-values to a vsam key is common practice if you are preparing
for browsing a file and want to start with first record in the file.


for the OC7, if you are NOT blowing up at
ADD K-1 TO CTR-INF-RECORD-COUNT

then
my guess is the record you are reading contains
garbage in field ORG.CES-KEY-CUSTOMER=NUMBER,


are you sure you have successfully read a record before the
comparison?

i would verify that switch RETURN-IO-SUCCESSFUL-IN-USG
is set properly
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Mon Oct 15, 2007 9:34 am
Reply with quote

Hi Every one,

I ran the code using xpeditor and found that the problem occurs when the code is trying to read the VSAM file. the return code is 10(End of file or no records matching to the key) But i manually checked the VSAM file in file-aid to find the records there. Any guesses for the possible causes for this error..?
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Mon Oct 15, 2007 9:40 am
Reply with quote

Sagar,

I tried to locate the offset. The parm LIST is working fine.. but am not able to use the parm NOOFF... its throwing an error... INVALID PARM...
Back to top
View user's profile Send private message
Earl

Active User


Joined: 17 Jun 2007
Posts: 148
Location: oklahoma

PostPosted: Mon Oct 15, 2007 7:20 pm
Reply with quote

endof FILE?

thats your problem.
you can not compare against a record that is not there.

change your program to NOT do the compare, when there is a non-zero
response from the read


see my previous reply
then
my guess is the record you are reading contains
garbage in field ORG.CES-KEY-CUSTOMER=NUMBER,


are you sure you have successfully read a record before the
comparison?
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Oct 15, 2007 8:21 pm
Reply with quote

Hi Sathyaraj,

You may want to try the following:
Code:
****** ***************************** Top of Data ******************************
000001        CBL NOOFF,LIST                                                   
000002        IDENTIFICATION  DIVISION.                                       
000003        PROGRAM-ID.     XXXXXX.                                       
000004        AUTHOR.         JACK xxx.                                   
000005       ******************************************************************
000006       * CHG DATE  |SVC REQ#|CHG AGT|DESCRIPTION                        *
000007       *=================================================================
000008       * 02/20/2007|00001557|Jx9999 |NEW PGM                            *
000009       ******************************************************************

I've been using it for years and it works fine.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Oct 15, 2007 8:28 pm
Reply with quote

Hello,

Quote:
I tried to locate the offset. The parm LIST is working fine.. but am not able to use the parm NOOFF... its throwing an error... INVALID PARM...
If you post the actual bit of code/jcl that you submitted, we may be able to offer suggestions.
Back to top
View user's profile Send private message
Earl

Active User


Joined: 17 Jun 2007
Posts: 148
Location: oklahoma

PostPosted: Mon Oct 15, 2007 9:01 pm
Reply with quote

looks to me like it is endof file condition causing the problem,

You are checking for endof file condition at wrong place in your logic.

your current code is falling through to the comparison on record-key,
you have no valid record in storage at that point.

change your code ..

to do this >>>

IF RETURN-END-OF-FILE-IN-USG
OR RETURN-RECORD-NOT-FOUND-IN-USG
MOVE SW-ON TO SW-EOF

THEN
ELSE
IF RETURN-IO-SUCCESSFUL-IN-USG
THEN
ADD K-1 TO CTR-INF-RECORD-COUNT
IF ORG-CES-KEY-CUSTOMER-NUMBER NOT EQUAL
WS-CUST-NO(SUB-TAB)
THEN
MOVE SW-ON TO SW-EOF
END-IF
ELSE
DISPLAY 'LOGIC PROBLEM'.
Back to top
View user's profile Send private message
kris22_24

New User


Joined: 28 Oct 2006
Posts: 18

PostPosted: Wed Oct 17, 2007 2:21 pm
Reply with quote

1)Refer the sysout of the job and get the next sequential instruction to be executed (offset)

2) Compile the program with LIST option

3)Check for the offset in the compilation list and get the respective statement number

4) Identify the statement this would be a numeric operation

5) Identify the source of the numeric data and correct it.
Back to top
View user's profile Send private message
rameshvaamshy
Currently Banned

New User


Joined: 19 Aug 2007
Posts: 14
Location: bangalore

PostPosted: Thu Oct 18, 2007 4:52 pm
Reply with quote

[quote="hemanth.nandas"]HI Satyaraj,

Welcome To Forum..

Quote:
S0C7 abend and trying for hours to fix it


There are more reason which cuases this abend.
Check All the possibilities.
1) Working-storage INTIALIZATION
2) Moving Non-Numeric item to Numeric item (Bad Data)
3) Out of Index
4) etc.

To Check all this and Debugg the same,

1. Use SYSUDUMP in your JCL,
2. Take the Offset of the variable Where you had got ERROR,
3. Match for the same in PROGRAM LISTING, Get the line Number, Then Locate For the same which directs you to the command/variable.

Which Version control are you using?

If Endevor, Go To Foot Print Listing, Find Offset, Which gives Command as well Line number.

Then Fix It.

Anyhow, If it Doesn't work out, Then Post your problem Very clearly, I mean under Which environmemt(contorl version) you are running this?[/qu
Back to top
View user's profile Send private message
Earl

Active User


Joined: 17 Jun 2007
Posts: 148
Location: oklahoma

PostPosted: Thu Oct 18, 2007 7:31 pm
Reply with quote

Sathyaraj,

are you still have this problem ? and if fixed, what did you do?
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Tue Oct 23, 2007 10:38 am
Reply with quote

Thnx a ton everyone for your support.

Finally I fixed the abend.. Expeditor helped me the most…

The problem was like I was checking the date field in the file with the current date..

Since I took the dated backup of the loadlib and was using the new one I dint notice that the date conversion sub program code was not in the loadlib… So the working storage variable had junk values and during the comparison it abended…. I copied the load module to the new lib and everything is fine.. I just have one more query.. Usually we get SOC806 if load module is missing rite..? but duno why it happened the other way this time…

Thanx once again everyone for your support in this thread… Looking forward for your support in the future too..
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Oct 24, 2007 3:07 am
Reply with quote

Hello,

Quote:
Usually we get SOC806 if load module is missing rite..?
Is it possible that there was/is some other module of the same name that was somewhere in the lib concatenation?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Help needed in automation cics transa... CLIST & REXX 1
No new posts Call an hlasm from REXX in batch and ... CLIST & REXX 4
No new posts What is the most complex abend you've... Mainframe Interview Questions 8
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
Search our Forums:

Back to Top