<?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 proc report conditional header in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-report-conditional-header/m-p/843602#M333507</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am generating a report using proc report and need the column header to print either A Period&amp;nbsp; &amp;nbsp;or B Period based on the value of the variable trtn in my dataset. An if/else statement does not work.&amp;nbsp; Can anyone provide a suggestion?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you&lt;/P&gt;
&lt;P&gt;KC&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kc2_1-1668093080382.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77166iBD7E558E82E7684F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kc2_1-1668093080382.png" alt="Kc2_1-1668093080382.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;proc report data=final style=[outputwidth=100%];&lt;BR /&gt;columns trtn ord ("__Period A______________________________________________________________________________________________________" &lt;BR /&gt;c1 ("______________________________CTCAE Grade______________________________" c3 c4 c5 c6 c7)); &lt;BR /&gt;/* if trtn=3 then columns trtn ord ("__Period B___________________________________________________________________________________________________" */&lt;BR /&gt;/* c1 ("______________________________CTCAE Grade______________________________" c3 c4 c5 c6 c7)); */&lt;BR /&gt;&lt;BR /&gt;define trtn /order noprint order=internal;&lt;BR /&gt;define ord /order noprint order=internal;&lt;BR /&gt;define c1 /group display "System Organ Class/^ Preferred Term [1]" style(column)=[cellwidth=20% just=LEFT asis=on] style(header)=[just=l];&lt;/P&gt;
&lt;P&gt;define c3 / "Grade 1/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;&lt;BR /&gt;define c4 / "Grade 2/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;&lt;BR /&gt;define c5 / "Grade 3/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;&lt;BR /&gt;define c6 / "Grade 4/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;&lt;BR /&gt;define c7 / "Grade 5/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;break after trtn / page; &lt;BR /&gt;compute after ord; &lt;BR /&gt;line ' ';&lt;BR /&gt;endcomp; &lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2022 15:15:18 GMT</pubDate>
    <dc:creator>Kc2</dc:creator>
    <dc:date>2022-11-10T15:15:18Z</dc:date>
    <item>
      <title>proc report conditional header</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-conditional-header/m-p/843602#M333507</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am generating a report using proc report and need the column header to print either A Period&amp;nbsp; &amp;nbsp;or B Period based on the value of the variable trtn in my dataset. An if/else statement does not work.&amp;nbsp; Can anyone provide a suggestion?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you&lt;/P&gt;
&lt;P&gt;KC&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kc2_1-1668093080382.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77166iBD7E558E82E7684F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kc2_1-1668093080382.png" alt="Kc2_1-1668093080382.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;proc report data=final style=[outputwidth=100%];&lt;BR /&gt;columns trtn ord ("__Period A______________________________________________________________________________________________________" &lt;BR /&gt;c1 ("______________________________CTCAE Grade______________________________" c3 c4 c5 c6 c7)); &lt;BR /&gt;/* if trtn=3 then columns trtn ord ("__Period B___________________________________________________________________________________________________" */&lt;BR /&gt;/* c1 ("______________________________CTCAE Grade______________________________" c3 c4 c5 c6 c7)); */&lt;BR /&gt;&lt;BR /&gt;define trtn /order noprint order=internal;&lt;BR /&gt;define ord /order noprint order=internal;&lt;BR /&gt;define c1 /group display "System Organ Class/^ Preferred Term [1]" style(column)=[cellwidth=20% just=LEFT asis=on] style(header)=[just=l];&lt;/P&gt;
&lt;P&gt;define c3 / "Grade 1/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;&lt;BR /&gt;define c4 / "Grade 2/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;&lt;BR /&gt;define c5 / "Grade 3/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;&lt;BR /&gt;define c6 / "Grade 4/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;&lt;BR /&gt;define c7 / "Grade 5/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;break after trtn / page; &lt;BR /&gt;compute after ord; &lt;BR /&gt;line ' ';&lt;BR /&gt;endcomp; &lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 15:15:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-conditional-header/m-p/843602#M333507</guid>
      <dc:creator>Kc2</dc:creator>
      <dc:date>2022-11-10T15:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: proc report conditional header</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-conditional-header/m-p/843621#M333519</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Unless you used BY group processing so you could create a report for every value of TRTN, I think you might need a SAS Macro program, something like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1668096835270.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77170i74274D8B57C3B2BE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1668096835270.png" alt="Cynthia_sas_0-1668096835270.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; This is not the exact format as your output, since it uses SASHELP.CLASS for the example, but it illustrates the general concept. There are other ways to write the macro program, of course, but I based this on an example I already had available.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 16:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-conditional-header/m-p/843621#M333519</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-11-10T16:15:30Z</dc:date>
    </item>
  </channel>
</rss>

