PING
0.9
Statistical data handling and processing in production environment
|
Return the basename, extension or library (directory) of a given dataset.
path
: full path of a file (e.g., a SAS file);res
: (option) string representing the result to output; it is either ext
for the extension of the dataset (e.g., sas7bdat
), or dir
for the directory/library where the dataset is stored, or base
(default when res is not passed) for the basename of the dataset to be returned, or file
for the complete filename without its path (i.e., both basename and extension concatenated together when the extension is present, the basename only otherwise); default: res=file
, i.e. the filename is returned.name
: desired output string depending on input res
value.
Let us consider the file where this macro is defined, then the operation:
returns name=file_name
for instance, while:
returns name=&G_PING_LIBAUTO
, and:
returns name=file_name.sas
.
Run macro %_example_file_name
for more examples.
res=dir
) is always a path without the final '/'; in the case a simple basename is passed, an empty directory path is returned.