Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mfv_existsashdat.sas File Reference

Checks whether a CAS sashdat dataset exists in persistent storage. More...

Go to the source code of this file.

Detailed Description

Can be used in open code, eg as follows:

%if %mfv_existsashdat(libds=casuser.sometable) %then %put  yes it does!;

The function uses dosubl() to run the table.fileinfo action, for the specified library, filtering for *.sashdat tables. The results are stored in a WORK table (&outprefix._&lib). If that table already exists, it is queried instead, to avoid the dosubl() performance hit.

To force a rescan, just use a new &outprefix value, or delete the table(s) before running the function.

Parameters
[in]libdslibrary.dataset
[out]outprefix=(work.mfv_existsashdat) Used to store current HDATA tables to improve subsequent query performance. This reference is a prefix and is converted to &prefix._{libref}
Returns
output returns 1 or 0
Version
0.2
Author
Mathieu Blauw

Definition in file mfv_existsashdat.sas.