How to solve S0C7?

All sort of Mainframes Interview Questions.
Post Reply
Richa Chauhan
Registered Member
Posts: 18
Joined: Sat Sep 27, 2014 9:13 pm

How to solve S0C7?

Post by Richa Chauhan »

What are the reasons for which S0C7 comes and many programmers come out saying to look out for OFFSET ADDRESS and see the DUMP and trace the statement where SOC7 occured. But I wan to know, what is the actual procedure to solve SOC7 in general ? Is there any specific method available which can be used?

I also know the answer the look at offset and then search that offset in the compile listing but I was asked refine my answer, which I could not do.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: How to solve S0C7?

Post by William Collins »

You find the instruction which failed. You find what data is being referenced in that instruction. If only one piece of data is involved (for instance the instruction is a ZAP (Zero and Add Packed), or a CVB (Convert to Binary) then you know it is bad. If two pieces of data are involved, establish which is bad (and it can be both).

Bear in mind that the bad data may be in compiler temporary storage, so you may have to track back to the original source (for instance if the source is not packed-decimal).

Then you have to answer why is the data bad, and why bad data got where it did. The answers to this can either be simple and straightforward, or complex.

How you get to go about the first part, you already know. Always check that the listing you are using to identify the offset is the same date as the program which failed. If you need to recompile, ensure that the offset at the very least shows the same instruction, and verify that the length of the program is the same. It is not a perfect verification that you are looking at the same generated code, but it is the best you can do if you have to recompile.

The rest depends. In development, the answers are usually easy for the final part. Further up-the-line, especially in Production, things get more difficult, because the "obvious" would/should have caused the program to fail long before it reached Production.

There can be a myriad of causes, so the specifics of the actual problem are what are important to start your travels to a solution. There is no general "do this, do that" which will allow you to solve the complex problems, because they are very specific.

As examples, there are two ways that "stepping on storage" can cause a S0C7. Your data can get mangled. The executable code or compiler areas themselves can get mangled. The latter you may see only once or twice in 10 years, or even never at all. You have to forget it as a possibility (since in 99.999% of cases it will not be the problem, so it'll get in the way) and at the same time be aware of it, such that if the evidence points that way and nowhere else, then you don't miss it.
durga
Registered Member
Posts: 53
Joined: Mon Jul 01, 2013 3:28 pm

Re: How to solve S0C7?

Post by durga »

You can also look at this thread also: viewtopic.php?f=10&t=1291
Richa Chauhan
Registered Member
Posts: 18
Joined: Sat Sep 27, 2014 9:13 pm

Re: How to solve S0C7?

Post by Richa Chauhan »

Thnks William.

[quote"]How you get to go about the first part, you already know. Always check that the listing you are using to identify the offset is the same date as the program which failed. If you need to recompile, ensure that the offset at the very least shows the same instruction, and verify that the length of the program is the same. It is not a perfect verification that you are looking at the same generated code, but it is the best you can do if you have to recompile.[quote]

What is the "length of the program"? Is that like if the variables are added the length is changed? But how does a length matter apart from an abend when we verify that the length is same at the time of abend as at the time of abend?
User avatar
Akatsukami
Global Moderator
Global Moderator
Posts: 122
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL
Contact:

Re: How to solve S0C7?

Post by Akatsukami »

Richa Chauhan wrote:But how does a length matter apart from an abend when we verify that the length is same at the time of abend as at the time of abend?
If the lengths differ then the machine code (and static variables) differ; the two modules are very unlikely to abend at the same offset (indeed, one may not abend at all!)

As Mr. Collins says, if you recompile the source to get a listing, you must verify that that source and listing correspond to the program that abended. That the two are of the same length does not guarantee that they are identical, but that they guarantees that they are not.
"I come to the conclusion that, men loving according to their own will and fearing according to that of the prince, a wise prince should establish himself on that which is in his own control and not in that of others." -- Niccolò Machiavelli
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”