BookmarkSubscribeRSS Feed
Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

hi all,

Can i have more macro codes written within one and then by callin the main one i can execute all?

Also,i have  a dataset out of each i am supposed to run 10 queries.Can I write a macro that would export the results of all these 10 queries into one workbook of excel?

Not all of the 10 queries have the same column names.And if macro cant,can i do the same then without macro?

I am need to have the results of all the queries on one workbook so i can easily populate some tables in excel

Please anyone

4 REPLIES 4
Tom
Super User Tom
Super User

A macro can call anything you want it to.

%macro big ;

    %small1;

     %small2;

%mend big;

Look at using ODS TAGSETS.EXCELXP to generate output into multiple sheets of an excel file.

Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

sorry i meant to ask if i can have sas export the results of all the queries onto one worksheet but i guess  that s not possible.

Thanks Tom

Reeza
Super User

Yes you can, but you'll have different tables is all, they won't stack up.

ods tagsets.excelxp file="c:\temp\test.xls";

proc print data=sashelp.class;

run;

proc print data=sashelp.cars;

run;

ods tagsets.excelxp close;

Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

will try this today

Thanks Reeza

sas-innovate-2024.png

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.

 

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
  • 4 replies
  • 784 views
  • 0 likes
  • 3 in conversation