@Tom Hi Tom, I ran the macro in my SAS 9.2, there is some ERRORs, but still get the correct result from the LOG window. MPRINT(DS2POST): * Get member label in format of dataset option. ;
MPRINT(DS2POST): * Get dataset contents information in a format to facilitate code
generation.;
MPRINT(DS2POST): * Column names reflect data statement that uses the value. ;
MPRINT(DS2POST):
*----------------------------------------------------------------------------;
MPRINT(DS2POST): proc sql noprint;
NOTE: Line generated by the invoked macro "DS2POST".
2 select cats('(label=',quote(trim(memlabel),"'"),')') into :memlabel trimmed
-------
22
76
2 ! from dictionary.tables where libname="&libname"
SYMBOLGEN: Macro variable LIBNAME resolves to WORK
SYMBOLGEN: Macro variable MEMNAME resolves to A3
MPRINT(DS2POST): select cats('(label=',quote(trim(memlabel),"'"),')') into :memlabel trimmed
from where libname="WORK" and memname="A3" and not missing(memlabel) ;
ERROR 22-322: Syntax error, expecting one of the following: ',', -, FROM, SEPARATED, THROUGH,
THRU.
ERROR 76-322: Syntax error, statement will be ignored.
... View more