DATA Step, Macro, Functions and more

Check at each level

Reply
Super Contributor
Posts: 647

Check at each level

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.
Frequent Contributor
Posts: 102

Re: Check at each level

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.
Super Contributor
Posts: 647

Re: Check at each level

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!
Super Contributor
Super Contributor
Posts: 3,174

Re: Check at each level

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.
Ask a Question
Discussion stats
  • 3 replies
  • 116 views
  • 0 likes
  • 3 in conversation