PING  0.9
Statistical data handling and processing in production environment
str_dsname

Find the first unused dataset (named with a generic name), adding a prefix and a numeric suffix as large as necessary to make it unique.

%let name=%str_dsname(name, prefix=_, lib=WORK);

Arguments

  • name : string to be used as a core name for the dataset;
  • prefix : (option) leading string/character to be used; default: prefix=_;
  • lib : (option) name of the library where the desired dataset shall be found; by default: empty, i.e. WORK is used.

Returns

name : unique name of the desired dataset.

Examples

Consider the situation where some dataset _dsn, _dsn1 and _dsn2 already exist in the WORKing library, then:

%let name=%str_dsname(dsn, prefix=_);

returns name=_dsn3.

Run macro %_example_str_dsname for examples.

Note

This macro is derived from the %MultiTransposeNewDatasetName macro of L. Joseph.

See also

%ds_check, %ds_create, %str_dslist, EXIST, [MultiTranspose][http://www.medicine.mcgill.ca/epidemiology/joseph/pbelisle/multitranspose.html].