MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error Handling in REXX

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
sbvw76
Beginner


Joined: 28 Jan 2003
Posts: 3
Topics: 1

PostPosted: Tue Jan 28, 2003 12:28 am    Post subject: Error Handling in REXX Reply with quote

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
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Tue Jan 28, 2003 12:32 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
sbvw76
Beginner


Joined: 28 Jan 2003
Posts: 3
Topics: 1

PostPosted: Tue Jan 28, 2003 12:47 am    Post subject: Reply with quote

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
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Tue Jan 28, 2003 2:05 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
sbvw76
Beginner


Joined: 28 Jan 2003
Posts: 3
Topics: 1

PostPosted: Thu Jan 30, 2003 8:36 am    Post subject: Reply with quote

Thanks Manas!.

It is working as I wanted....
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group