<?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: How to fill the repetitive value in Pro Tabulate statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-repetitive-value-in-Pro-Tabulate-statement/m-p/275746#M55188</link>
    <description>&lt;P&gt;Thanks Ballard and Cynthia. How to use Proc Report to do that?&lt;/P&gt;&lt;P&gt;Apperciated for your helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2016 17:11:19 GMT</pubDate>
    <dc:creator>LL5</dc:creator>
    <dc:date>2016-06-07T17:11:19Z</dc:date>
    <item>
      <title>How to fill the repetitive value in Pro Tabulate statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-repetitive-value-in-Pro-Tabulate-statement/m-p/275697#M55151</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FROM THE RESULT TABLE BELOW, HOW TO FILL THE REPETITIVE VALUE IN COLUMN A IN THE PRO BABULATE STATEMENT? IN THIS EXAMPLE, THE REPETITIVE VALUE WOULD BE "NEW YORK" IN FROM CELL A4 TO A7.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;TABULATE&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DATA&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=DATABASE.NY&lt;/FONT&gt; &lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;CLASS&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; STATE CITY;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;VAR&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; PROFIT EXPENSE;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TABLE&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; (STATE=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;""&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;*(CITY=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;""&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;)ALL=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"TOTAL"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;FONT face="Courier New"&gt;PROFIT EXPENSE&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;/&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;BOX&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"STATE"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt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2285&lt;/TD&gt;&lt;TD&gt;460&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;QUEEN&lt;/TD&gt;&lt;TD&gt;1143&lt;/TD&gt;&lt;TD&gt;827&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;TOTAL&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;6950&lt;/TD&gt;&lt;TD&gt;3369&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 07 Jun 2016 15:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-repetitive-value-in-Pro-Tabulate-statement/m-p/275697#M55151</guid>
      <dc:creator>LL5</dc:creator>
      <dc:date>2016-06-07T15:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill the repetitive value in Pro Tabulate statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-repetitive-value-in-Pro-Tabulate-statement/m-p/275724#M55175</link>
      <description>&lt;P&gt;Proc tabulate doesn't have an option for that.&lt;/P&gt;
&lt;P&gt;You may consider creating an output data set from Tabulate and then manipulating that set and then print the result. Or perhaps proc report.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 16:03:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-repetitive-value-in-Pro-Tabulate-statement/m-p/275724#M55175</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-06-07T16:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill the repetitive value in Pro Tabulate statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-repetitive-value-in-Pro-Tabulate-statement/m-p/275738#M55183</link>
      <description>Hi:&lt;BR /&gt;  In addition to BallardW's suggestions, you can use PROC REPORT to get what you want.&lt;BR /&gt;cynthia</description>
      <pubDate>Tue, 07 Jun 2016 16:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-repetitive-value-in-Pro-Tabulate-statement/m-p/275738#M55183</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-06-07T16:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill the repetitive value in Pro Tabulate statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-repetitive-value-in-Pro-Tabulate-statement/m-p/275746#M55188</link>
      <description>&lt;P&gt;Thanks Ballard and Cynthia. How to use Proc Report to do that?&lt;/P&gt;&lt;P&gt;Apperciated for your helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 17:11:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-repetitive-value-in-Pro-Tabulate-statement/m-p/275746#M55188</guid>
      <dc:creator>LL5</dc:creator>
      <dc:date>2016-06-07T17:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill the repetitive value in Pro Tabulate statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-repetitive-value-in-Pro-Tabulate-statement/m-p/276024#M55271</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; This is the default behavior from PROC REPORT:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3535i4A9EDFAE8A9705C5/image-size/original?v=v2&amp;amp;px=-1" alt="proc_report1.png" title="proc_report1.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You can make a COMPUTED item in PROC REPORT to "copy" the variable of interest (in my example, PRODUCT) down all the other report rows for the group. This is the output produced by the program below.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3536i0D108DC11A7BA201/image-size/original?v=v2&amp;amp;px=-1" alt="proc_report_fill_row_rest_output.png" title="proc_report_fill_row_rest_output.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is also an additonal #3 example that shows adding a summary line under each group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
** make small subset;
proc sort data=sashelp.shoes out=newshoes;
  by product region;
  where product in ('Boot' 'Slipper') and
        region in ('Asia' 'Canada' 'Western Europe');
run;
  
ods html file='c:\temp\fill_rows_example.html';
proc report data=newshoes;
  title '1) default behavior';
  column product region sales inventory returns;
  define product / group f=$14.;
  define region / group;
run;
   
proc report data=newshoes;
  title '2a) fill each row example using a COMPUTED item';
  column product showprod region sales inventory returns;
  define product / group f=$14.;
  define showprod / computed f=$14. 'Product';
  define region / group;
  compute before product;
    length holdval $25;
	holdval = product;
  endcomp;
  compute showprod/character length=25;
    showprod = holdval;
  endcomp;
run;
   
proc report data=newshoes;
  title '2b) final report -- using NOPRINT for Group var PRODUCT';
  column product showprod region sales inventory returns;
  define product / group f=$14. noprint;
  define showprod / computed f=$14. 'Product';
  define region / group;
  compute before product;
    length holdval $25;
	holdval = product;
  endcomp;
  compute showprod/character length=25;
    showprod = holdval;
  endcomp;
run;

proc report data=newshoes;
  title '3) With Summary Line';
  column product showprod region sales inventory returns;
  define product / group f=$14. noprint;
  define showprod / computed f=$14. 'Product';
  define region / group;
  break after product / summarize style=Header;
  compute before product;
    length holdval $25;
	holdval = product;
  endcomp;
  compute showprod/character length=25;
    showprod = holdval;
	if upcase(_break_) = 'PRODUCT' then
	  showprod = catx(' ', showprod,'Total');
  endcomp;
run;

ods html close;
title;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Jun 2016 16:35:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-repetitive-value-in-Pro-Tabulate-statement/m-p/276024#M55271</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-06-08T16:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to fill the repetitive value in Pro Tabulate statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-repetitive-value-in-Pro-Tabulate-statement/m-p/277085#M55587</link>
      <description>Thanks cynthia!</description>
      <pubDate>Tue, 14 Jun 2016 01:40:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fill-the-repetitive-value-in-Pro-Tabulate-statement/m-p/277085#M55587</guid>
      <dc:creator>LL5</dc:creator>
      <dc:date>2016-06-14T01:40:16Z</dc:date>
    </item>
  </channel>
</rss>

