
Rick A. answered 03/25/19
Experienced SAS Professional
In your DATA step, add an END= option to the SET statement.
END=variable
creates and names a temporary variable that contains an end-of-file indicator. The variable, which is initialized to zero, is set to 1 when SET reads the last observation of the last data set listed. This variable is not added to any new data set.
For example:
data file2;
set mylib.file1 end=EOF;
if EOF then do;
/* place end of file logic here */
end;
run;