Page 1 of 1

What are the reasons for which S0C7 occurs?

Posted: Wed Dec 23, 2015 1:39 pm
by Sushma Rahul
Hi,

I got this question to face, which left me not answering anything as the interviewer said the answer himself.

What are the reasons for which S0C7 occurs? Many programmers would say to look out for OFFSET ADDRESS and see the DUMP and trace the statement where S0C7 occurred? Does this really help, what is the actual procedure to solve S0C7 in general ? Can you share a specific method available?

Re: What are the reasons for which S0C7 occurs?

Posted: Wed Dec 23, 2015 2:43 pm
by William Collins
S0C7 occurs only when a Decimal Instruction is used (consult the Principles of Operation) and the data provided does not conform to the convention for packed-decimal data.

Note that if the source field is a DISPLAY/zoned-decimal field, you need to apply the consideration of conformation once the data has been "packed" (see the description of CVP or PACK in the same manual).

And yes, that is the general way to start finding out what is going on. Since the answer to that question can be "almost anything" it is not possible to generalise beyond that point.

Re: What are the reasons for which S0C7 occurs?

Posted: Wed Dec 23, 2015 6:54 pm
by Robert Sample
As William indicated, a S0C7 occurs only when a decimal instruction attempts to use data not valid for it. However, the reasons for the S0C7 are numerous and varied:
- the programmer could have put invalid data in the field (on purpose or by accident)
- the field could have been read from a file which had invalid data in the field
- storage overlay could have overlaid the field with invalid data
- subprogram linkage could be messed up causing a referenced field to not have valid data
etc

Re: What are the reasons for which S0C7 occurs?

Posted: Mon Dec 28, 2015 12:02 pm
by Sushma Rahul
Thanks for the answers. This should help me in next interview for the similar question...