Custom Search

Tuesday, June 28, 2011

S0C7

S0C7 is a data exception error in mainframe. You will get this error when you try to access a numeric (packed decimal) field that has non-numeric contents. S0C7 errors in COBOL are easy to debug today because of abend-aid tools. Depending on your system setup, a COBOL program abending with S0C7 would either display the exact compile listing line # where you encountered the S0C7, or it will give the Hex Loc that you can use to find the line # in your compile listing.

Abend-aid will also tell you the address of the variable that caused the error and its contents. You can also check the contents of all your working storage variables at the time of the abend by looking at the dump.

Remember, you don't need to narrow down the cause of your error by adding Displays. The compile listing and the dump are your friends. Knowing the statement that caused the error and knowing the contents of your variables at the time of the abend would give you the capability to track and resolve S0C7.