BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8
Hi,
As part of process, I have to check if a physicians name is correctly given in the raw data with a lookup table that has correct physician's names and also on drugnames if they are spelled correctly.
If there is a physician whose name is not correctly spelled I will output a error dataset.
The check i want to do is, if the error dataset is created ,stop the process there, so that I can fix the physician's name and update the lookup table if a new physician comes for the current data and resume the process.
3 REPLIES 3
JackHamilton
Lapis Lazuli | Level 10
It will be easier to unconditionally create the error data set, and halt execution if the data set contains observations.

=====
data _null_;

set errors;

abort abend;

run;
=====

Will abort if there are errors, and continue merrily along with the error data set has observations.
SASPhile
Quartz | Level 8
abort abend will exit out of the system.But all I need is to stop at that point so that I can check the error and start the process again.

By usig abort abend, I will have to login back to the sas system again.This will confuse the user I guess!
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
In a DATA step, test the variable used with the NOBS= on the SET statement, and issue a STOP; statement if there are observations found in the ERRORS file.

Scott Barry
SBBWorks, Inc.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 796 views
  • 0 likes
  • 3 in conversation