View previous topic :: View next topic
|
Author |
Message |
er_ani
New User
Joined: 04 May 2007 Posts: 3 Location: India
|
|
|
|
How to capture the system abends or any unexpected error in cobol program. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
er_ani,
Quote: |
How to capture the system abends or any unexpected error in cobol program. |
You mean to say abend handling. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Unless you find and license some kind of strange/special product, i don't believe you'll be able to "capture" these abends. Usually when these kinds of abends occur, there is no way to continue - the environment for that particular execution is no longer stable.
These abends are raised when the application tries to do something that is not do-able, like execute an assembler iinstruction that does not exist (0c1) or move data to an invalid memory address (0c4).
The way to "capture" abends is to write code in such a way that abend conditions are not raised.
If you could "capture" an 0c4 (for example) what would you do next? |
|
Back to top |
|
|
er_ani
New User
Joined: 04 May 2007 Posts: 3 Location: India
|
|
|
|
Hi Dick, some files are dynamically created in the programs. The filename will differ each time as it has a runsequence and data as the qualifiers. These files have to be deleted either the program abend or successful. If the programs goes successfully or if it abend with user abend then it calls the abend routine where these dynamically created files get deleted. But if the program abend with system error(mostly we get SOC1 because of space problem) then it should call the abend routine to delete these files. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I don't understand how a space problem causes an 0c1. How does this occur?
Depending on how your process creates these files, you could possibly run a step after the problem step (COND=EVEN) that would delete the necessary files. If the process knows which files to create, the follow-on step can know which to delete.
Again, my focus would be preventing the system abend, not dealing with it. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Quote: |
If the programs goes successfully or if it abend with user abend then it calls the abend routine where these dynamically created files get deleted. But if the program abend with system error(mostly we get SOC1 because of space problem) then it should call the abend routine to delete these files. |
Is it manadtory to call abend routine to delete these files? Can't it be done through disp parameter directly? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Probably not as they are created after the jcl is already running. . . |
|
Back to top |
|
|
|