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



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

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

Postby Zakir » Thu Aug 09, 2012 11:36 am

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.
Zakir
 
Posts: 5
Joined: Thu Aug 09, 2012 11:26 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby Robert Sample » Thu Aug 09, 2012 2:37 pm

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.

These users thanked the author Robert Sample for the post:
pmartyn (Wed Apr 24, 2013 12:59 am)
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

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

Postby BillyBoyo » Thu Aug 09, 2012 2:54 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby dick scherrer » Thu Aug 09, 2012 7:47 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

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

Postby Zakir » Fri Aug 10, 2012 7:42 am

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.
Zakir
 
Posts: 5
Joined: Thu Aug 09, 2012 11:26 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby dick scherrer » Fri Aug 10, 2012 7:50 am

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. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

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

Postby Robert Sample » Fri Aug 10, 2012 8:16 am

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. :)
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

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

Postby Zakir » Fri Aug 10, 2012 9:48 am

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.
Zakir
 
Posts: 5
Joined: Thu Aug 09, 2012 11:26 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby Zakir » Fri Aug 10, 2012 9:52 am

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.
Zakir
 
Posts: 5
Joined: Thu Aug 09, 2012 11:26 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby Robert Sample » Fri Aug 10, 2012 4:30 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post