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

Writing an ABEND program for my system


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pingte

Active User


Joined: 03 Dec 2005
Posts: 120
Location: india

PostPosted: Tue Aug 28, 2007 3:58 pm
Reply with quote

Hi,

I am trying to write a ABEND program for my system.
(i.e. a program which can be used to forcefully abend)

Can anyone provide me with a sample code ... or least how to go about it?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 28, 2007 4:09 pm
Reply with quote

IBM has modules that you can CALL to force an ABEND. But, why?

The program that forces the ABEND (your new pgm) is the primary program in the dump. What use is that?

If you can code all your application programs to CALL your new ABEND program, you can code all your application programs to display or dump relevant data to aid in debugging, and exit with a return code > zero that can be recognized by a scheduler.

In other words, to come down in an orderly fashion.

To force the ops-sys to go thru an ABEND process is unnecessary, wasteful, thoughtless, pointless, costly and just dumb. It takes a ton of cycles for the ops-sys to handle and ABEND.

but, if you just gotta. The tried and proven method is to preload a comp-3 field (either by redef or a Reference Modification move) with spaces and add 1.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Aug 28, 2007 4:14 pm
Reply with quote

If your shop does not already have a standard routine to call for that purpose, you could set a high return code and let your schedular catch the error and flush the rest of the job.
Alternately, a dynamic call to a non-existent module will work too.....
Back to top
View user's profile Send private message
pingte

Active User


Joined: 03 Dec 2005
Posts: 120
Location: india

PostPosted: Tue Aug 28, 2007 4:16 pm
Reply with quote

thanks for the info!

Quote:

If you can code all your application programs to CALL your new ABEND program, you can code all your application programs to display or dump relevant data to aid in debugging, and exit with a return code > zero that can be recognized by a scheduler.


Can you please let me know how to achieve that.. i.e how to code application program to display or dump relevant data...

Also for my information .. can you please let me know what are the IBM modules that can be called to force a abend?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Aug 28, 2007 5:14 pm
Reply with quote

Isn't there an LE module that can abend batch?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Aug 28, 2007 6:07 pm
Reply with quote

Indeed, there is an LE Callable service, called CEE3ABD.

O.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 28, 2007 6:07 pm
Reply with quote

GA22-7560-03 Lang Env Debugging Guide and a quote from the the Application Programming on z/OS Guide (attachment):
Quote:
errors and handling bad input. Your application should be designed to:
  • Validate input before using it
  • Issue detailed error messages to simplify debugging
  • Consider adding diagnostic tracing to the application which can be turned on and off
  • Where possible, terminate a single transaction without taking down the entire server


Even if your environment is OS390, LE exists. Go to the IBM Library Server Library and search for SA22-756 Books, pick the ones for your OS. There are routines for dumps, (the debugging guide, above, explains how to read a dump), and task termination requests that return a user-requested return code for the system.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Aug 28, 2007 7:30 pm
Reply with quote

Hello,

To force a user abend, you might try:
Code:
 77  COMP-CODE PIC S9999 COMP.
          .
          .
          .
  MOVE uuuu TO COMP-CODE.
  CALL "ILBOABN0" USING COMP-CODE.
Back to top
View user's profile Send private message
pingte

Active User


Joined: 03 Dec 2005
Posts: 120
Location: india

PostPosted: Wed Aug 29, 2007 9:45 am
Reply with quote

Thanks a lot everyone for sharing ur knowledge!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Aug 29, 2007 12:53 pm
Reply with quote

You're welcome icon_smile.gif

Do you have something running to do what you need?

If you post your solution, others may benefit from it.
Back to top
View user's profile Send private message
pingte

Active User


Joined: 03 Dec 2005
Posts: 120
Location: india

PostPosted: Wed Aug 29, 2007 1:06 pm
Reply with quote

Sure!

I am dynamically calling a non existing module to serve my purpose.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts Using API Gateway from CICS program CICS 0
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
Search our Forums:

Back to Top