<?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 PUT a value in Column header for PROC REPORT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/509739#M137082</link>
    <description>&lt;P&gt;Is there a way to bring the value from a PROC FREQ output dataset into a PROC REPORT header?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For ex:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=data;&lt;BR /&gt;tables cohort/out=cohortct (drop=percent rename=count=cohortct);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data cohortct;&lt;BR /&gt;set cohortct;&lt;BR /&gt;cohortct2=strip(cohort||' (N='||(strip(cohortct)||')'));&lt;BR /&gt;put&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;cohortct2&lt;/FONT&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to display&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;COHORTCT2&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in a column header in PROC REPORT.&lt;/P&gt;
&lt;P&gt;This is the value of COHORTCT2&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1A (N=4)&lt;BR /&gt;1B (N=7)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc report data=table1 split="|" ;&lt;BR /&gt;column cohort number1 ;&lt;BR /&gt;define cohort/display center style(column)={width=1in} 'Cohort&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;I need the numbers for COHORTCT here&lt;/FONT&gt;';&lt;BR /&gt;define number1 /display right style(column)={width=.5in} 'Subjects experiencing Grade 1';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can this be done?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Nov 2018 23:38:15 GMT</pubDate>
    <dc:creator>saslove</dc:creator>
    <dc:date>2018-11-01T23:38:15Z</dc:date>
    <item>
      <title>PUT a value in Column header for PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/509739#M137082</link>
      <description>&lt;P&gt;Is there a way to bring the value from a PROC FREQ output dataset into a PROC REPORT header?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For ex:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=data;&lt;BR /&gt;tables cohort/out=cohortct (drop=percent rename=count=cohortct);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data cohortct;&lt;BR /&gt;set cohortct;&lt;BR /&gt;cohortct2=strip(cohort||' (N='||(strip(cohortct)||')'));&lt;BR /&gt;put&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;cohortct2&lt;/FONT&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to display&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;COHORTCT2&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in a column header in PROC REPORT.&lt;/P&gt;
&lt;P&gt;This is the value of COHORTCT2&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1A (N=4)&lt;BR /&gt;1B (N=7)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc report data=table1 split="|" ;&lt;BR /&gt;column cohort number1 ;&lt;BR /&gt;define cohort/display center style(column)={width=1in} 'Cohort&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;I need the numbers for COHORTCT here&lt;/FONT&gt;';&lt;BR /&gt;define number1 /display right style(column)={width=.5in} 'Subjects experiencing Grade 1';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can this be done?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 23:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/509739#M137082</guid>
      <dc:creator>saslove</dc:creator>
      <dc:date>2018-11-01T23:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: PUT a value in Column header for PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/509761#M137087</link>
      <description>&lt;P&gt;How about&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data COHORTCT;
  set COHORTCT;
  COHORTCT2=strip(COHORT||' (N='||(strip(COHORTCT)||')'));
  call symputx ('cohortct2',COHORTCT2);
run;
 
proc report data=TABLE1 split="|" ;
  column COHORT NUMBER1 ;
  define COHORT/display center style(column)={width= 1in} "Cohort &amp;amp;cohortct2";
  define NUMBER1/display right style(column)={width=.5in} 'Subjects experiencing Grade 1';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 02:03:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/509761#M137087</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-11-02T02:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: PUT a value in Column header for PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/509932#M137164</link>
      <description>It only displays &amp;amp;cohortct2 on the column header. It doesn't display the&lt;BR /&gt;numbers I want.&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Nov 2018 15:57:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/509932#M137164</guid>
      <dc:creator>saslove</dc:creator>
      <dc:date>2018-11-02T15:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: PUT a value in Column header for PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/510279#M137336</link>
      <description>&lt;P&gt;Did you copy the code as is?&amp;nbsp; Including the double quotes?&lt;/P&gt;</description>
      <pubDate>Sun, 04 Nov 2018 21:47:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/510279#M137336</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-11-04T21:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: PUT a value in Column header for PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/510500#M137387</link>
      <description>&lt;P&gt;You are right. The double quote did work - but the problem is it only keeps the second row.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1A (N=4)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1B (N=7)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;on the column header. But it only shows the second row,&amp;nbsp;1B (N=7).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you know why?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 17:34:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/510500#M137387</guid>
      <dc:creator>saslove</dc:creator>
      <dc:date>2018-11-05T17:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: PUT a value in Column header for PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/510583#M137414</link>
      <description>&lt;P&gt;&lt;EM&gt;it only keeps the second row.&amp;nbsp;Do you know why?&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Because that's what you programmed.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I reckon the easiest is for you to create two macro variables&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;if _N_=1 then call symput...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;if _N_=2 then call symput...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 20:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/510583#M137414</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-11-05T20:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: PUT a value in Column header for PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/510667#M137438</link>
      <description>Ok yes I created where statements and it worked perfectly. Thanks so much for your response. &lt;BR /&gt;</description>
      <pubDate>Tue, 06 Nov 2018 02:13:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-a-value-in-Column-header-for-PROC-REPORT/m-p/510667#M137438</guid>
      <dc:creator>saslove</dc:creator>
      <dc:date>2018-11-06T02:13:04Z</dc:date>
    </item>
  </channel>
</rss>

