IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need code to get either SOC1 or SOC4 abend


IBM Mainframe Forums -> COBOL Programming
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
sureshbabu.jv

New User


Joined: 11 Apr 2006
Posts: 41
Location: Chennai

PostPosted: Sat Feb 26, 2011 5:01 pm
Reply with quote

Hello
I declared the OCCURS clause with 0 to 1000 and applied both DEPENDING on SUBSCRIPT item and INDEXED by Index item for that OCCURS clause. I would like to abend the program once suscript/index item reaches 1000 with SOC4. Please suggest me how to code it.

I tried with

ADD 1 to subscript item.

SET idex item upby 1.

If subsript item/Index item >1000

fail the program..

End-if

It's not working out.. Please provide me the logic to meet this requirement.

Thanks,
Venkata
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Sat Feb 26, 2011 7:47 pm
Reply with quote

There is a subscript range checking option for the compiler (see the COBOL Programming Guide manual through the manuals link at the top of the page for details). This option imposes a performance penalty, so it may not be something you want in a production program.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Sat Feb 26, 2011 11:01 pm
Reply with quote

why not abend it with a user abend
more effective and clear from any point of view!
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Sat Feb 26, 2011 11:18 pm
Reply with quote

Quote:
If subsript item/Index item >1000

fail the program..

End-if

Define an 01 level to LINKAGE (IE: 01 LS-KTR PIC S9(07) COMP-3), do NOT establish addressability to it and within the above IF, ADD 1 to LS-KTR and you should raise a S0C4 Protection Exception.

Other than raising an ABEND after exceeding 1000, what's the real reason you need to do this?

As a failsafe, compile the program using the NOOPT compiler option, which creates a non-optimized load module.

Bill
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sun Feb 27, 2011 1:15 am
Reply with quote

Hello,

FWIW - well managed systems do not permit generating "System" abends when the code detects an invalid situation.

A "User" abend is generated and if done well, the same User abend means the same thing across an application or an entire operating environment.

A System abend should only happen when there is an unplanned situation.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1049
Location: Richmond, Virginia

PostPosted: Sun Feb 27, 2011 1:21 am
Reply with quote

Minor point - these are actually S0C4, etc. I.e., zero-C-4. Often pronounced oh-C-4 because it looks like that, but be aware that these are hex numbers.

Agreeing with other replies - let the system generate system abends, not nyou. If you force one, how will you know when you really do have one?

Why, BTW, abend? You can perfectly well issue error messages (in various ways) and use the RETURN-CODE to control further processing, both within this job and via your scheduler.
Back to top
View user's profile Send private message
sureshbabu.jv

New User


Joined: 11 Apr 2006
Posts: 41
Location: Chennai

PostPosted: Sun Feb 27, 2011 11:30 am
Reply with quote

Hello,

Thank you so much for all your responses!!!

I tried with User abend and was able to get it done with U0001 but per client requirement I need to make changes to the program to have SOC1/SOC4 abend once the provider count has been exceed 1000. SO I am trying my level best to meet that requirement.

I can't go to client saying not possible or difficult to get system abend.

I heard if I move bad data to subsript item will get SOC4 or if i move 9(3) to 9(2) item will get SOC4.

Please let me know what exatly bad data,what need to move for getting the system abends.. IS it like otherthan numeric values

Please suggest me.. I have to try it once I back to work on monday..

Thank you!
Suresh
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sun Feb 27, 2011 12:38 pm
Reply with quote

Hello,

Apologies, but your client is a fool to insist on this (if this is entirely client-driven) . . . icon_sad.gif

My clients expect me to point out when they are doing (or have done) something that will cause problems.

Suggest if this nonsense is to be pursed that an S0C7 or SOCB (divide by zero) be generated as they are quite simple to generate.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Sun Feb 27, 2011 4:55 pm
Reply with quote

You can call an assembler routine to do all your abends parametrized :

ABEND X'0C4',,,SYSTEM

or

ABEND X'0C1',,,SYSTEM

etc.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Sun Feb 27, 2011 9:04 pm
Reply with quote

too bad that smart solutions are obfuscated by stupid requirements icon_biggrin.gif
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1049
Location: Richmond, Virginia

PostPosted: Sun Feb 27, 2011 11:38 pm
Reply with quote

What is wrong with a simple "ERROR - TOO MANY WHATCHCALLITS" AND RC=12?

You have the unending burden of educating your users. Good luck.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Feb 28, 2011 12:39 am
Reply with quote

Hello,

Quote:
You can call an assembler routine to do all your abends parametrized :
I surely hope this mess of an environment does not allow programmers to write assembler.. .

Quote:
What is wrong with a simple "ERROR - TOO MANY WHATCHCALLITS" AND RC=12?
Some witless-one insists on the system abend. . .

I should probably discontinue participation in this topic before i become really blunt/unkind. . .

d
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Mon Feb 28, 2011 1:00 am
Reply with quote

time to lock the topic
it really has no place in a professional forum

the ts should read the cobol manuals on how to issue a user abend
and do his job in advising his client about proper solutions!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Call an hlasm from REXX in batch and ... CLIST & REXX 4
No new posts What is the most complex abend you've... Mainframe Interview Questions 8
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts ISAM and abend S03B JCL & VSAM 10
Search our Forums:

Back to Top