sas >> When does ERRORABEND really do ?

by Richard A. DeVenezia » Fri, 21 Sep 2007 05:11:07 GMT

Some macro code is run in either foreground (DMS) or background (BATCH).
If an error 'state' occurs, I want the FORE session to simply show an error
and continue


By what criteria does ERRORABEND truly end the session ?

I run a sas program in batch using a custom command line having
sas.exe -errorabend -noterminal -sysin

I thought maybe an ERROR: message in the log might do it -- nope. If it
did, I was hoping the session would end before the second %put ERROR.

-------------------
options nosource
%macro x;

%put NOTE: HI;
%put WARNING: There;
%put ERROR: Bye;
%put ERROR: Bye;

%let SYSERR = 1;

%mend;

%x
%x;

data _null_;
run;

data class;
set sashelp.class;
run;
-------------------

Some types of real ERRORS dont either! This code goes into error check mode
instead of abending.
-------------------
options nosource
%macro x;

%put ERROR: Bye;
%let SYSERR = 1;

%mend;

%x
%x;

data _null_;
run;

data class;
set sashelp.class;
run;
-------------------

Finally, an ERROR in a data step does cause abend. The final data step
never runs because sas abends due to the error of the previous data step.
-------------------
options nosource
%macro x;

%put ERROR: Bye;
%let SYSERR = 1;

%mend;

%x
%x;

data class;
set sashelp.class;
run;

data _null_;
set xyz;
run;

data class;
set sashelp.class;
run;
-------------------


Richard A. DeVenezia



Similar Threads

1. Can't be done?

I have a couple of lines of code captured in a SAS abbreviation.

I would like the code to include two additional commands:

(1) the equivalent of entering a ctrl-c and
(2) issue the equivalent of clicking on the command bar, entering submit,
and pressing the enter key (or clicking on the run icon).

The SAS support group says it can't be done.  Surely, one of you already
knows or can figure out how to do it!

Art

2. Another way of doing this?

3. Some things are done better without SAS

4. how is join done in sybase proc sql?

5. Doing proc sort nodupkey in a data step

Hi All

I was wondering if I can do the same thing that

proc sort data=ps.psmpl out=x1 nodupkey;
by hospid lastnm firstnm;
run;

is doing in a data step (eventually with even less coding).

Thanks Toby

6. More information on what we are doing with Cholesky Decomposition

7. Cancel message titled: subsetting then doing t-test?

Hi,
I found the answer to my original question. Yeah!
Jan

The moral test of government is how it treats those who are in the dawn of life, the children; those who are in the twilight of life, the aged; and those who are in the shadows of life, the sick, the needy and the handicapped.         - Hubert H. Humphrey

8. SAS 8.2 (Base) test is available for Beta testing-BETA TESTING IS DONE