Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need code to get either SOC1 or SOC4 abend

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Need code to get either SOC1 or SOC4 abend
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: 7913
Location: Bellevue, IA

PostPosted: Sat Feb 26, 2011 7:47 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Sat Feb 26, 2011 11:01 pm    Post subject: Reply to: Need code to get either SOC1 or SOC4 abend
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sat Feb 26, 2011 11:18 pm    Post subject: Reply to: Need code to get either SOC1 or SOC4 abend
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

Site Director


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

PostPosted: Sun Feb 27, 2011 1:15 am    Post subject:
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

Active Member


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

PostPosted: Sun Feb 27, 2011 1:21 am    Post subject:
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    Post subject: Reply to: Need code to get either SOC1 or SOC4 abend
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

Site Director


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

PostPosted: Sun Feb 27, 2011 12:38 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Sun Feb 27, 2011 4:55 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Sun Feb 27, 2011 9:04 pm    Post subject: Reply to: Need code to get either SOC1 or SOC4 abend
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

Active Member


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

PostPosted: Sun Feb 27, 2011 11:38 pm    Post subject:
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

Site Director


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

PostPosted: Mon Feb 28, 2011 12:39 am    Post subject: Reply to: Need code to get either SOC1 or SOC4 abend
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Feb 28, 2011 1:00 am    Post subject: Reply to: Need code to get either SOC1 or SOC4 abend
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.    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us