BookmarkSubscribeRSS Feed
jint83
Calcite | Level 5

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. 

3 REPLIES 3
PaigeMiller
Diamond | Level 26

@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.

--
Paige Miller
jint83
Calcite | Level 5

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:

https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_glmselect_s...

 

I need the selected predictors outputed in an excel or text or as a string.

novinosrin
Tourmaline | Level 20

Play with sashelp.vmacro view

 

data want;

set sashelp.vmacro;

run;

 

filter the sashelp.vmacro  dictionary view however you like. HTH

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1505 views
  • 0 likes
  • 3 in conversation