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
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.