<?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: Array in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Array/m-p/22624#M3984</link>
    <description>assuming you have already loaded data from excel, just add this small unit of code[pre]&lt;BR /&gt;
   * after "by" group columns loaded ;&lt;BR /&gt;
   retain _ret_by1 ;&lt;BR /&gt;
   if not missing( &amp;amp;by_var1 ) then _ret_by1 = &amp;amp;by_var1 ;&lt;BR /&gt;
   else &amp;amp;by_var1 = ret_by1 ;&lt;BR /&gt;
   retain _ret_by2 ;&lt;BR /&gt;
   if not missing( &amp;amp;by_var2 ) then _ret_by2 = &amp;amp;by_var2 ;&lt;BR /&gt;
   else &amp;amp;by_var2 = _ret_by2 ; &lt;BR /&gt;
   .... etc .... &lt;BR /&gt;
   drop _ret_: ;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
I've streamlined the code so you can extend it for as many by-vars as you need. Just remember to establish the macro vars with the names of the BY-vars to be "retained". The code above should work in SAS9 whatever data-types the BY-vars have.&lt;BR /&gt;
&lt;BR /&gt;
hope this helps !&lt;BR /&gt;
&lt;BR /&gt;
PeterC</description>
    <pubDate>Mon, 09 Jun 2008 16:04:16 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-06-09T16:04:16Z</dc:date>
    <item>
      <title>Array</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Array/m-p/22623#M3983</link>
      <description>I have a large excel file for which I need to fill in missing data for a by-group&lt;BR /&gt;
variable.      It has a value of the by-variable for the first observation in &lt;BR /&gt;
each by-group but the remaining observations are missing the &lt;BR /&gt;
by-variable .   I would like to occupy that field. Also, the file may not have &lt;BR /&gt;
the same number of observations within each by-group.</description>
      <pubDate>Tue, 03 Jun 2008 16:24:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Array/m-p/22623#M3983</guid>
      <dc:creator>uabcms</dc:creator>
      <dc:date>2008-06-03T16:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Array</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Array/m-p/22624#M3984</link>
      <description>assuming you have already loaded data from excel, just add this small unit of code[pre]&lt;BR /&gt;
   * after "by" group columns loaded ;&lt;BR /&gt;
   retain _ret_by1 ;&lt;BR /&gt;
   if not missing( &amp;amp;by_var1 ) then _ret_by1 = &amp;amp;by_var1 ;&lt;BR /&gt;
   else &amp;amp;by_var1 = ret_by1 ;&lt;BR /&gt;
   retain _ret_by2 ;&lt;BR /&gt;
   if not missing( &amp;amp;by_var2 ) then _ret_by2 = &amp;amp;by_var2 ;&lt;BR /&gt;
   else &amp;amp;by_var2 = _ret_by2 ; &lt;BR /&gt;
   .... etc .... &lt;BR /&gt;
   drop _ret_: ;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
I've streamlined the code so you can extend it for as many by-vars as you need. Just remember to establish the macro vars with the names of the BY-vars to be "retained". The code above should work in SAS9 whatever data-types the BY-vars have.&lt;BR /&gt;
&lt;BR /&gt;
hope this helps !&lt;BR /&gt;
&lt;BR /&gt;
PeterC</description>
      <pubDate>Mon, 09 Jun 2008 16:04:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Array/m-p/22624#M3984</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-06-09T16:04:16Z</dc:date>
    </item>
  </channel>
</rss>

