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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 660 views
  • 0 likes
  • 3 in conversation