<?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 Re: PDF Report: How to let a group variable show up multiple times ... in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PDF-Report-How-to-let-a-group-variable-show-up-multiple-times/m-p/267231#M15775</link>
    <description>&lt;P&gt;Hi Jian,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example (tested only with listing output, though):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input CPN VINT State $ Var1 Var2;
cards;
1 5 FL 1 11
1 8 DE 2 22
1 8 AK 3 33
1 5 MI 4 44
2 7 TX 5 55
2 4 NC 6 66
2 7 GA 7 77
;

/* Before */

proc report data=test nowd;
column CPN VINT State Var1 Var2;
define CPN / order;
define VINT / order descending;
define State / order;
define Var1 / sum;
define Var2 / sum;
run;

/* After */

proc report data=test nowd;
column CPN CPN_ VINT State Var1 Var2;
define CPN / order noprint;
define CPN_ / computed '      CPN';
define VINT / order descending;
define State / order;
define Var1 / sum;
define Var2 / sum;
compute before CPN;
  temp=CPN;   /* Temporary variable TEMP is assigned the */
endcomp;      /* value of CPN when it is available.      */
compute before VINT;
  temp2=VINT; /* Temporary variable TEMP2 is assigned the */
endcomp;      /* value of VINT when it is available.      */
compute CPN_ / character length=9;
  if temp2 ne lag(temp2) then CPN_=put(temp,9.);
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is partially based on &lt;A href="http://www.sas.com/store/books/categories/usage-and-reference/carpenter-s-complete-guide-to-the-sas-report-procedure/prodBK_60966_en.html" target="_blank"&gt;Carpenter's Complete Guide to the SAS® REPORT Procedure&lt;/A&gt;, p. 185 f., where they repeat the value on &lt;EM&gt;each&lt;/EM&gt; row. I introduced the LAG function to restrict the repetitions to the first observation of each VINT group. Maybe there is a more elegant way to accomplish this.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Apr 2016 14:08:08 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2016-04-29T14:08:08Z</dc:date>
    <item>
      <title>PDF Report: How to let a group variable show up multiple times ...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PDF-Report-How-to-let-a-group-variable-show-up-multiple-times/m-p/267213#M15774</link>
      <description>&lt;P&gt;I have a pdf report like below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.......&lt;/P&gt;
&lt;P&gt;column CPN VINT State Var1 Var2&lt;/P&gt;
&lt;P&gt;define CPN / order;&lt;/P&gt;
&lt;P&gt;define VINT / order descending;&lt;/P&gt;
&lt;P&gt;define State / order;&lt;/P&gt;
&lt;P&gt;define Var1 /sum;&lt;/P&gt;
&lt;P&gt;define Var2 /sum;&lt;/P&gt;
&lt;P&gt;........&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the final report,&lt;/P&gt;
&lt;P&gt;CPN only show up once for each CPN group (CPN1 X All VINT X All State).&lt;/P&gt;
&lt;P&gt;I want CPN show up every time for each VINT not once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I do it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jian&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2016 12:42:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PDF-Report-How-to-let-a-group-variable-show-up-multiple-times/m-p/267213#M15774</guid>
      <dc:creator>jzhang332002</dc:creator>
      <dc:date>2016-04-29T12:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Report: How to let a group variable show up multiple times ...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PDF-Report-How-to-let-a-group-variable-show-up-multiple-times/m-p/267231#M15775</link>
      <description>&lt;P&gt;Hi Jian,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example (tested only with listing output, though):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input CPN VINT State $ Var1 Var2;
cards;
1 5 FL 1 11
1 8 DE 2 22
1 8 AK 3 33
1 5 MI 4 44
2 7 TX 5 55
2 4 NC 6 66
2 7 GA 7 77
;

/* Before */

proc report data=test nowd;
column CPN VINT State Var1 Var2;
define CPN / order;
define VINT / order descending;
define State / order;
define Var1 / sum;
define Var2 / sum;
run;

/* After */

proc report data=test nowd;
column CPN CPN_ VINT State Var1 Var2;
define CPN / order noprint;
define CPN_ / computed '      CPN';
define VINT / order descending;
define State / order;
define Var1 / sum;
define Var2 / sum;
compute before CPN;
  temp=CPN;   /* Temporary variable TEMP is assigned the */
endcomp;      /* value of CPN when it is available.      */
compute before VINT;
  temp2=VINT; /* Temporary variable TEMP2 is assigned the */
endcomp;      /* value of VINT when it is available.      */
compute CPN_ / character length=9;
  if temp2 ne lag(temp2) then CPN_=put(temp,9.);
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is partially based on &lt;A href="http://www.sas.com/store/books/categories/usage-and-reference/carpenter-s-complete-guide-to-the-sas-report-procedure/prodBK_60966_en.html" target="_blank"&gt;Carpenter's Complete Guide to the SAS® REPORT Procedure&lt;/A&gt;, p. 185 f., where they repeat the value on &lt;EM&gt;each&lt;/EM&gt; row. I introduced the LAG function to restrict the repetitions to the first observation of each VINT group. Maybe there is a more elegant way to accomplish this.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2016 14:08:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PDF-Report-How-to-let-a-group-variable-show-up-multiple-times/m-p/267231#M15775</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-29T14:08:08Z</dc:date>
    </item>
  </channel>
</rss>

