Thursday, January 21, 2010

Use EXIST to check dataset

Use a simple DATA step function named 'EXIST' to check for the existence of a certain SAS data file.
%MACRO D_EXIST(INPUT);
%SYSFUNC(EXIST(&INPUT))
%MEND D_EXIST;
The macro %D_EXIST could be called from within an expression.
%IF %D_EXIST(SASHELP.CLASS) %THEN %DO;
The function EXIST can also be used to find other type of data sets in the directory by changing the types of members that it should look for.

No comments: