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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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