Returns the format of a variable. More...
Go to the source code of this file.
Uses varfmt function to identify the format of a particular variable. Usage:
data test; format str1 $1. num1 datetime19.; str2='hello mum!'; num2=666; stop; run; %put %mf_getVarFormat(test,str1); %put %mf_getVarFormat(work.test,num1); %put %mf_getVarFormat(test,str2,force=1); %put %mf_getVarFormat(work.test,num2,force=1); %put %mf_getVarFormat(test,renegade);
returns:
$1. DATETIME19. $10. 8. NOTE: Variable renegade does not exist in test
libds | Two part dataset (or view) reference. |
var | Variable name for which a format should be returned |
force | Set to 1 to supply a default if the variable has no format |
Definition in file mf_getvarformat.sas.