<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Get (N=) to show in PROC REPORT in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Get-N-to-show-in-PROC-REPORT/m-p/755724#M36802</link>
    <description>&lt;P&gt;So I calculated the totals as such:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; proc sql noprint;
 select sum(A_N_ALL) into :EthnicA trimmed from catdem where CAT = 1;
 select sum(B_N_ALL) into :EthnicB trimmed from catdem where CAT = 1;
 select sum(A_N_ALL) into :RaceA trimmed from catdem where CAT = 2;
 select sum(B_N_ALL) into :RaceB trimmed from catdem where CAT = 2;
 select sum(A_N_OBESE) into :ObeseA trimmed from catdem where CAT = 1;
 select sum(B_N_OBESE) into :ObeseB trimmed from catdem where CAT = 1;
 select sum(A_N_NOT_OBESE) into :NotObeseA trimmed from catdem where CAT = 1;
 select sum(B_N_NOT_OBESE) into :NotObeseB trimmed from catdem where CAT = 1;
 select sum(A_N_SEVERELY_OBESE) into :SeverelyObeseA trimmed from catdem where CAT = 1;
 select sum(B_N_SEVERELY_OBESE) into :SeverelyObeseB trimmed from catdem where CAT = 1;
run;&lt;/PRE&gt;&lt;P&gt;With these results in the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;3397 %put &amp;amp;=EthnicA &amp;amp;=RaceA &amp;amp;=EthnicB &amp;amp;=RaceB; /*totals match up*/&lt;BR /&gt;ETHNICA=120 RACEA=120 ETHNICB=20 RACEB=20&lt;BR /&gt;3398 %put &amp;amp;=ObeseA &amp;amp;=ObeseB &amp;amp;=NotObeseA &amp;amp;=NotObeseB $=SeverelyObeseA &amp;amp;=SeverelyObeseB;&lt;BR /&gt;OBESEA=24 OBESEB=2 NOTOBESEA=58 NOTOBESEB=12 $=SeverelyObeseA SEVERELYOBESEB=6&lt;/PRE&gt;&lt;P&gt;Now I want these totals to show up in the column titles when I run PROC REPORT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;proc report data = catdem nowd split = '*'
 %reportStyle

 column CAT CHAR 
	('Cohort A' ('BMI &amp;lt; 30 *kg/m ^{super 2} ^n (N = &amp;amp;&amp;amp;NotObeseA)' A_N_NOT_OBESE A_P_NOT_OBESE) ('30 ^{unicode 2264} BMI ^{unicode 2264}*kg/m ^{super 2} ^n (N = &amp;amp;&amp;amp;ObeseA)' A_N_OBESE A_P_OBESE) ('BMI &amp;gt; 40 *kg/m ^{super 2} ^n (N = &amp;amp;&amp;amp;SeverelyObeseA)' A_N_SEVERELY_OBESE A_P_SEVERELY_OBESE) ('All Subjects (N = &amp;amp;&amp;amp;EhtnicA)' A_N_ALL A_P_ALL))
	('Cohort B' ('BMI &amp;lt; 30 *kg/m ^{super 2} ^n (N = &amp;amp;&amp;amp;NotObeseB)' B_N_NOT_OBESE B_P_NOT_OBESE) ('30 ^{unicode 2264} BMI ^{unicode 2264}*kg/m ^{super 2} ^n (N = &amp;amp;&amp;amp;ObeseB)' B_N_OBESE B_P_OBESE) ('BMI &amp;gt; 40 *kg/m ^{super 2} ^n (N = &amp;amp;&amp;amp;SeverelyObeseB)' B_N_SEVERELY_OBESE B_P_SEVERELY_OBESE) ('All Subjects (N = &amp;amp;&amp;amp;EhtnicB)' B_N_ALL B_P_ALL));&lt;BR /&gt;...&lt;/PRE&gt;&lt;P&gt;When I do this, I get N = &amp;amp;&amp;amp;NotObeseA, etc. instead of N = 58. What can I do to fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jul 2021 18:38:08 GMT</pubDate>
    <dc:creator>mariko5797</dc:creator>
    <dc:date>2021-07-21T18:38:08Z</dc:date>
    <item>
      <title>Get (N=) to show in PROC REPORT</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-N-to-show-in-PROC-REPORT/m-p/755724#M36802</link>
      <description>&lt;P&gt;So I calculated the totals as such:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; proc sql noprint;
 select sum(A_N_ALL) into :EthnicA trimmed from catdem where CAT = 1;
 select sum(B_N_ALL) into :EthnicB trimmed from catdem where CAT = 1;
 select sum(A_N_ALL) into :RaceA trimmed from catdem where CAT = 2;
 select sum(B_N_ALL) into :RaceB trimmed from catdem where CAT = 2;
 select sum(A_N_OBESE) into :ObeseA trimmed from catdem where CAT = 1;
 select sum(B_N_OBESE) into :ObeseB trimmed from catdem where CAT = 1;
 select sum(A_N_NOT_OBESE) into :NotObeseA trimmed from catdem where CAT = 1;
 select sum(B_N_NOT_OBESE) into :NotObeseB trimmed from catdem where CAT = 1;
 select sum(A_N_SEVERELY_OBESE) into :SeverelyObeseA trimmed from catdem where CAT = 1;
 select sum(B_N_SEVERELY_OBESE) into :SeverelyObeseB trimmed from catdem where CAT = 1;
run;&lt;/PRE&gt;&lt;P&gt;With these results in the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;3397 %put &amp;amp;=EthnicA &amp;amp;=RaceA &amp;amp;=EthnicB &amp;amp;=RaceB; /*totals match up*/&lt;BR /&gt;ETHNICA=120 RACEA=120 ETHNICB=20 RACEB=20&lt;BR /&gt;3398 %put &amp;amp;=ObeseA &amp;amp;=ObeseB &amp;amp;=NotObeseA &amp;amp;=NotObeseB $=SeverelyObeseA &amp;amp;=SeverelyObeseB;&lt;BR /&gt;OBESEA=24 OBESEB=2 NOTOBESEA=58 NOTOBESEB=12 $=SeverelyObeseA SEVERELYOBESEB=6&lt;/PRE&gt;&lt;P&gt;Now I want these totals to show up in the column titles when I run PROC REPORT.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;proc report data = catdem nowd split = '*'
 %reportStyle

 column CAT CHAR 
	('Cohort A' ('BMI &amp;lt; 30 *kg/m ^{super 2} ^n (N = &amp;amp;&amp;amp;NotObeseA)' A_N_NOT_OBESE A_P_NOT_OBESE) ('30 ^{unicode 2264} BMI ^{unicode 2264}*kg/m ^{super 2} ^n (N = &amp;amp;&amp;amp;ObeseA)' A_N_OBESE A_P_OBESE) ('BMI &amp;gt; 40 *kg/m ^{super 2} ^n (N = &amp;amp;&amp;amp;SeverelyObeseA)' A_N_SEVERELY_OBESE A_P_SEVERELY_OBESE) ('All Subjects (N = &amp;amp;&amp;amp;EhtnicA)' A_N_ALL A_P_ALL))
	('Cohort B' ('BMI &amp;lt; 30 *kg/m ^{super 2} ^n (N = &amp;amp;&amp;amp;NotObeseB)' B_N_NOT_OBESE B_P_NOT_OBESE) ('30 ^{unicode 2264} BMI ^{unicode 2264}*kg/m ^{super 2} ^n (N = &amp;amp;&amp;amp;ObeseB)' B_N_OBESE B_P_OBESE) ('BMI &amp;gt; 40 *kg/m ^{super 2} ^n (N = &amp;amp;&amp;amp;SeverelyObeseB)' B_N_SEVERELY_OBESE B_P_SEVERELY_OBESE) ('All Subjects (N = &amp;amp;&amp;amp;EhtnicB)' B_N_ALL B_P_ALL));&lt;BR /&gt;...&lt;/PRE&gt;&lt;P&gt;When I do this, I get N = &amp;amp;&amp;amp;NotObeseA, etc. instead of N = 58. What can I do to fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 18:38:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-N-to-show-in-PROC-REPORT/m-p/755724#M36802</guid>
      <dc:creator>mariko5797</dc:creator>
      <dc:date>2021-07-21T18:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get (N=) to show in PROC REPORT</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-N-to-show-in-PROC-REPORT/m-p/755726#M36803</link>
      <description>&lt;P&gt;Macro variables do not resolve inside single quotes. Replace the quotes around macro variables with " quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; (&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;&lt;/FONT&gt;BMI &amp;lt; 30 *kg/m ^{super 2} ^n (N = &amp;amp;&amp;amp;NotObeseA)&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;" &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 18:45:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-N-to-show-in-PROC-REPORT/m-p/755726#M36803</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-21T18:45:10Z</dc:date>
    </item>
  </channel>
</rss>

