Hi guys,
I'm trying to assign individual titles to multiple PROC MEANS outputs in the macro as shown below. Any idea how to achieve proc means output has proper TITLEs after the names of datasets? Right now, all proc mean outputs are produced to:
DATA FOR &NAME |
%LET NAME=&TAB;
PROC MEANS DATA=&AGE_TAB MIN MAX MAXDEC=2 MEAN MEDIAN;
VAR N_BLOCK;
TITLE 'DATA FOR &NAME';
RUN;
%SYMDEL;
%MACRO MODELS(TAB,TAB1,BLOCK_TAB,AGE_TAB);
PROC SQL;
CREATE TABLE &TAB1 AS SELECT
...
QUIT;
PROC SQL;
CREATE TABLE &BLOCK_TAB AS
SELECT FIPS, AGECAT,SUM(OUTCOME) AS N_BLOCK
FROM &TAB1
GROUP BY FIPS,AGECAT;
QUIT;
PROC SQL;
CREATE TABLE &AGE_TAB
...FROM &BLOCK_TAB
QUIT;
%LET NAME=&TAB;
PROC MEANS DATA=&AGE_TAB MIN;
VAR N_BLOCK;
TITLE 'DATA FOR &NAME';
RUN;
%MEND MODELS;
%MODELS(Oral_Pharynx ,Oral_Pharynx_U ,B_Oral_Pharynx ,AGE_Oral_Pharynx );
title "Data for &name";
Use double-quotes, not single quotes, when you are working with a macro variable.
title "Data for &name";
Use double-quotes, not single quotes, when you are working with a macro variable.
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!
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.
Ready to level-up your skills? Choose your own adventure.