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

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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