View previous topic :: View next topic |
Author |
Message |
sbvw76 Beginner
Joined: 28 Jan 2003 Posts: 3 Topics: 1
|
Posted: Tue Jan 28, 2003 12:28 am Post subject: Error Handling in REXX |
|
|
I like to know is there any generic way to handle the errors in a REXX program like in VB ...On error .
I'm doing lot of functionality inside the REXX program like allocating the dataset, deleting the datasets, calling PL/I programs etc....so, I want to track on any kind of errors immediately. If there is any error, my program should halt with proper error message.
Thanks in Advance
Sbvw76 |
|
Back to top |
|
|
Manas Biswal Intermediate
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Tue Jan 28, 2003 12:32 am Post subject: |
|
|
I would say that you check for "RC" which gets populated automatically after the execution of any REXX command. If it is not equal to zero, then tere is a warning or error. You can get the meaning of the return codes(they are numeric) from the REXX manual of the IBM book manager.
Regards,
Manas |
|
Back to top |
|
|
sbvw76 Beginner
Joined: 28 Jan 2003 Posts: 3 Topics: 1
|
Posted: Tue Jan 28, 2003 12:47 am Post subject: |
|
|
Now I will narrow my query.
I used to check for RC and also used OUTTRAP. But it still displays messages which starts with IRX.
Is there any stop/block the error messages displayed directly on the screen. I want to customize the error messages being displayed by mainframes.
Can I have a sample code of SIGNAL ON ERROR or SINGAL ON HALT.
Where are this statements being placed. Either on the first line while starting the rexx routine or check it before allocating or deleting the statements.....
Thanks in advance. |
|
Back to top |
|
|
Manas Biswal Intermediate
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Tue Jan 28, 2003 2:05 am Post subject: |
|
|
OK. Got it. Basically you are trying to handle the error conditions that are automatically checked by the REXX interpreter.
The REXX interpreter checks for the following 6 conditions -
SYNTAX
NOTREADY
ERROR
FAILURE
HALT and
NOVALUE.
If you don't want the REXX interpreter to handle these conditions and initiate the default action but want to handle these conditions yourself, then code the following as the first line of your REXX routine -
Code: |
SIGNAL ON ERROR/SYNTAX NAME error_para
|
Whenever in the routine, there is any error or syntax error then control branches to error_para where you can handle the error yourself.
You can turn off the handle in between anywhere in your routine by using
Code: |
SIGNAL OFF ERROR/SYNTAX
|
Further down the code, the default error handling by the REXX interpreter will take effect.
Hope this is the information that you wanted.
Regards,
Manas |
|
Back to top |
|
|
sbvw76 Beginner
Joined: 28 Jan 2003 Posts: 3 Topics: 1
|
Posted: Thu Jan 30, 2003 8:36 am Post subject: |
|
|
Thanks Manas!.
It is working as I wanted.... |
|
Back to top |
|
|
|
|