Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I Need an error handling macro

Status
Not open for further replies.

fasteddy

Programmer
Sep 3, 2001
3
GB
Hi
I'm quite new to sas and have the following problem.

I have a large peice of code and am looking for an error handling macro which will stop the whole process once an error of any kind is found. The code involves datastreps and proc steps. Does anyone have a macro to do this or any advice on how it might be done?
Ideally it would be best without having to put a new line of code into each step.

Thanks
 
Is this for debugging purposes? Cause you can highlight the code you want to run and only that section executes. Do this all the way down and you eventually debug most of the code.
Klaz
 
Unfortunatley there's thousands of lines of code. The user set it to run and then came back a couple of hours later to find there had been errors through the code but sas had continued running.
 
I think you want to use:

options errorabend;

This will totally kill the SAS session as soon as it hits a problem. I haven't got access to SAS here at the moment, use your doco to confirm the option name, or do

Proc Options;
run;

and scan through the list to make sure it's the right one (the results will be in your log file, SAS options, and System options are listed one after the other, so make sure you check which section of the list you are looking in).
Enjoy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top