Page 1 of 2

In what system variable is the SOC-7 / SOC-4 stored?

PostPosted: Thu Aug 09, 2012 11:36 am
by Zakir
I have to handle these data abends in my program by sending the error-code to the UI.
I have a COBOl - CICS program where i want to populate the error-code if a SOC-7/ SOc-4 abend occured.

Re: In what system variable is the SOC-7 / SOC-4 stored?

PostPosted: Thu Aug 09, 2012 2:37 pm
by Robert Sample
1. CICS COBOL programs don't get S0C7 and S0C4 abends -- CICS intercepts them and changes them to ASRA (etc) abend codes.

2. Abend codes are not stored in system variables -- because once the abend happens, your program is no longer running hence could not use the system variable.

3. Some problems can be trapped in CICS through various mechanisms, but if you get a storage violation (S0C4 abend or ASRA), for example, your program does not execute any more so there's nothing you could do with any information you got.

If you are truly wanting to learn how to deal with data and storage violations (which is what S0C7 and S0C4 abends are), you need to learn to code defensively and to be a very, very, very good coder.

Re: In what system variable is the SOC-7 / SOC-4 stored?

PostPosted: Thu Aug 09, 2012 2:54 pm
by BillyBoyo
Suggest you talk to your CICS support people about Robert's number 3. They are not going to like you coming up with something on your own.

If this is the business requirement, there must be something in the design/specification about it anyway, mustn't there? What is it going to do? Just say, "sorry, I fell over, try again when the program is fixed, please"?

Much, much, better to take good notice of Robert's final paragraph.

Re: In what system variable is the SOC-7 / SOC-4 stored?

PostPosted: Thu Aug 09, 2012 7:47 pm
by dick scherrer
Hello and welcome to the froum,

To echo what Robert and BB have said - you need to spend all the time needed to ensure the code does NOT abend rather than trying to gracefully deal with it for the user. They will appreciate much more transactons that always work rather than constantly being told there has been some kind of "internal error" that causes them to call for help.

Re: In what system variable is the SOC-7 / SOC-4 stored?

PostPosted: Fri Aug 10, 2012 7:42 am
by Zakir
Thanks All for your replies. really Appreciate that.

@Robert - Yes, you are right i meant storage violation (S0C4 abend or ASRA) only.
Here is my scenario. I have a main program which will LINK to another program which does all the processing and returns. If any storage violation (S0C4 abend or ASRA) occurs it will return to my main program (Handle-abend para) where I dump it and also does error population.

So my main program is still runing but the LINKed program is not.

I am thinking of using a flag in handle-abend para in main program. and setting that flag just before the RETURN of LINKed pgm. If that flag is in a not set condition in main program that means an ABEND has been encountered. Then setting the error message to 'Data error: Storage Violation'.

But I wanted the exact ABEND like ASRA etc... instead of giving a generic message like 'Data error: Storage Violation'.
Your comments please.

Re: In what system variable is the SOC-7 / SOC-4 stored?

PostPosted: Fri Aug 10, 2012 7:50 am
by dick scherrer
Hello,

Someone needs to fix the code so that the abends no longer occur. . .

Proper discipline developing and thorough testing is needed to prevent these abends. Many of the systems i've supported have not had a Production abend in years. . .

Re: In what system variable is the SOC-7 / SOC-4 stored?

PostPosted: Fri Aug 10, 2012 8:16 am
by Robert Sample
Personally, I think you are playing with fire and will get burned sooner or later. HANDLE ABEND does not handle all CICS ABEND conditions, so your transaction can still ABEND even if you use HANDLE ABEND. Furthermore, unless you know exactly what you're doing, it is not all that hard when coding up HANDLE ABEND logic to create a situation where you bring down the entire CICS region -- hardly a good thing for an application programmer! If you use a program in your HANDLE ABEND, for example, CICS expects that program to terminate with an ABEND (it's in the manual) -- so what did you gain by changing an ASRA or ASRB ABEND into your own ABEND code?

Multiple experienced CICS programmers (with a total of more than 100 years of CICS experience) are telling you that what you propose is not a good idea. You continue on this course, ignoring over 100 years of (often hard-earned) experience. I believe the appropriate quote is, "Fools rush in where angels fear to tread." -- although I don't think all of us qualify as angels. :)

Re: In what system variable is the SOC-7 / SOC-4 stored?

PostPosted: Fri Aug 10, 2012 9:48 am
by Zakir
dick scherrer wrote:Hello,

Someone needs to fix the code so that the abends no longer occur. . .

Proper discipline developing and thorough testing is needed to prevent these abends. Many of the systems i've supported have not had a Production abend in years. . .


Thanks. Will ask to fix the existing code.

Re: In what system variable is the SOC-7 / SOC-4 stored?

PostPosted: Fri Aug 10, 2012 9:52 am
by Zakir
Robert Sample wrote:Personally, I think you are playing with fire and will get burned sooner or later. HANDLE ABEND does not handle all CICS ABEND conditions, so your transaction can still ABEND even if you use HANDLE ABEND. Furthermore, unless you know exactly what you're doing, it is not all that hard when coding up HANDLE ABEND logic to create a situation where you bring down the entire CICS region -- hardly a good thing for an application programmer! If you use a program in your HANDLE ABEND, for example, CICS expects that program to terminate with an ABEND (it's in the manual) -- so what did you gain by changing an ASRA or ASRB ABEND into your own ABEND code?

Multiple experienced CICS programmers (with a total of more than 100 years of CICS experience) are telling you that what you propose is not a good idea. You continue on this course, ignoring over 100 years of (often hard-earned) experience. I believe the appropriate quote is, "Fools rush in where angels fear to tread." -- although I don't think all of us qualify as angels. :)


And I don't think I qualify as fool. :)
this is how the existing system is.

Re: In what system variable is the SOC-7 / SOC-4 stored?

PostPosted: Fri Aug 10, 2012 4:30 pm
by Robert Sample
Actually, Zakir, you are either a fool or a liar (or both). Where, exactly, in your original post do you make clear you are fixing existing code and not (as you imply) creating new code?
I have to handle these data abends in my program by sending the error-code to the UI.
I have a COBOl - CICS program where i want to populate the error-code if a SOC-7/ SOc-4 abend occured.
"where i (sic) want to populate" -- meaning the code doesn't already contain this.