Hello!
I've written a macro program and was wondering if there was a way to remove the title "The MEANS Procedure" from the output of the summary statistic portion (PROC MEANS) without using an ODS statement outside of the macro programming. Thank you in advance for your time!
ODS NOPROCTITLE;
%MACRO HS (DSNm = , Vbl = , Stats = N MEAN STDDEV,
NDec = 1);
TITLE1 "Summary Statistics for '&Vbl.' from Data Set '&DSNm'" ITALIC;
PROC MEANS
DATA = &DSNm
MAXDEC = &NDec
&Stats;
VAR &Vbl;
RUN;
TITLE;
%MEND HS;
ODS;
%HS (DSNm = work.test, Vbl = WtLb, Stats = Q1 MEDIAN Q3, NDec = 0)
If you don't want to see the proc-title, you have to use "ods noproctitle". But you could, of course move the ods-statement into the macro. Unfortunately, it seems that no function exists to check how an ods option is set. For normal options you could use the function getoption in a data-step to backup the original value, change it to fit your needs and revert back to the original setting at the end of you macro. To bad, that such a function doesn't exist for the ods-options, at least i haven't found one.
If you don't want to see the proc-title, you have to use "ods noproctitle". But you could, of course move the ods-statement into the macro. Unfortunately, it seems that no function exists to check how an ods option is set. For normal options you could use the function getoption in a data-step to backup the original value, change it to fit your needs and revert back to the original setting at the end of you macro. To bad, that such a function doesn't exist for the ods-options, at least i haven't found one.
Thank you so much! I appreciate your time. Yes, I wish such a function exists!
Amy
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.