Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
mf_getuniquename.sas
Go to the documentation of this file.
1 /**
2  @file mf_getuniquename.sas
3  @brief Returns a shortened (32 char) GUID as a valid SAS name
4  @details Use as follows:
5 
6  %let myds=%mf_getuniquename();
7  %put &=myds;
8 
9  which returns:
10 
11 > MCc59c750610321d4c8bf75faadbcd22
12 
13  @param prefix= set a prefix for the new name
14 
15  @version 9.3
16  @author Allan Bowe
17 **/
18 
19 
20 %macro mf_getuniquename(prefix=MC);
21  &prefix.%substr(%sysfunc(compress(%sysfunc(uuidgen()),-)),1,32-%length(&prefix))
22 %mend;