Hi, how do I save macro to a dataset, and export it to excel?
The export part is easy and I know, but I couldn't figure out how to save macro to a dataset [not a catalog, proc export doesn't work with catalogs]
Thank you.
@jint83 wrote:
Hi, how do I save macro to a dataset, and export it to excel?
The export part is easy and I know, but I couldn't figure out how to save macro to a dataset [not a catalog, proc export doesn't work with catalogs]
Thank you.
This is very unclear. There is no real way to save a macro in a dataset except as a long string of text, and there's no point in doing that. Could you explain in more detail what you want to do with this macro? (Normally macros are saved in .sas programs, you don't need to do anything more than that). There's absolutely no point to export a SAS macro to Excel.
As a long string of text, delimetered, is fine.
This is needed since proc glmselect outputs its selected predictors as a macro:_GLSIND1 , as indicated in:
I need the selected predictors outputed in an excel or text or as a string.
Play with sashelp.vmacro view
data want;
set sashelp.vmacro;
run;
filter the sashelp.vmacro dictionary view however you like. HTH
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.