SUPPORT / SAMPLES & SAS NOTES
 

Support

Sample 24670: Determine if a data set exists and conditionally execute additional steps

DetailsCodeOutputAboutRate It

This sample uses the EXIST function to determine if a SAS® data set exists. If the data set exists, execute a PROC PRINT step. If it does not exist, execute a DATA _NULL_ to write a message to the Listing destination stating that the data set does not exist.

The EXIST function returns a 1 if the data set exists, and a zero if the data set does not exist.




These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.