BookmarkSubscribeRSS Feed
robertrao
Quartz | Level 8

Hi,

I want to write Footnotes in the Proc Report

footnote1:Total number of discharges:22

footnote2:Discharges with headaches:5 etc etc

I will know the count only after running the code for the datasets.for example 22 is got i the log after running a piece of code

5 is got after running a piece of code..

Instead of manually entering the counts in Footnotes How can I get SAS to write automatically?????(USING SYMPUT?????)

Thank you

2 REPLIES 2
Ksharp
Super User

Yes. you should use a macro variable.

Cynthia_sas
SAS Super FREQ

Hi:

  You CAN use Macro variables, but you do not necessarily need CALL SYMPUT. SQL will do it too.

cynthia

proc sql;

  select distinct(sex), count(sex) into :cntgend1-:cntgend2, :tot1-:tot2

  from sashelp.class

  group by sex;

quit;

     

%put cntgend1=&cntgend1 tot1=&tot1;

%put cntgend2=&cntgend2 tot1=&tot2;

    

proc format;

  value $gfmt 'F' = 'Females'

              'M' = 'Males';

run;

    

ods html file='c:\temp\macvar.html';

    

proc report data=sashelp.class nowd;

title "The Report";

footnote "Total %sysfunc(putc(&cntgend1,$gfmt.)): &tot1";

footnote2 "Total %sysfunc(putc(&cntgend2,$gfmt.)): &tot2";

column age sex ('Average' height weight);

define age / group;

define sex / group;

define height / mean 'Height';

define weight / mean 'Weight';

run;

ods html close;

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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