<?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 creating array for each row based on a count in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/creating-array-for-each-row-based-on-a-count/m-p/38088#M9720</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; well i gues it solves my problem, as i want to make sure of the exact number of CO (columns). But after all it is a dataset so the maximum is OK for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But is there a way to make a different Nummer for each single row in my dataset because now i always count to the max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jul 2011 13:08:02 GMT</pubDate>
    <dc:creator>Filipvdr</dc:creator>
    <dc:date>2011-07-28T13:08:02Z</dc:date>
    <item>
      <title>creating array for each row based on a count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/creating-array-for-each-row-based-on-a-count/m-p/38086#M9718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;options symbolgen mlogic mprint;&lt;/P&gt;&lt;P&gt;data &amp;amp;InputParam/*(keep = Info Wafers_1 CO1-CO10)*/;&lt;/P&gt;&lt;P&gt;format Info Wafers_1 CO1-CO10;&lt;/P&gt;&lt;P&gt;set Recipe_transp;&lt;/P&gt;&lt;P&gt;Nr = countc(COL1,'+');&lt;/P&gt;&lt;P&gt;CALL SYMPUT('Nummer', Nr); &lt;/P&gt;&lt;P&gt;array CO{10} $50.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do L = 1 to Nr;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CO{L} = scan(COL1,L,'+');&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;Info = "&amp;amp;InputParam";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;what i want to do is replace the CO{10} by CO{Nr} but i dont know how?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 10:43:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/creating-array-for-each-row-based-on-a-count/m-p/38086#M9718</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2011-07-28T10:43:50Z</dc:date>
    </item>
    <item>
      <title>creating array for each row based on a count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/creating-array-for-each-row-based-on-a-count/m-p/38087#M9719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not quite sure what you are trying to do.&amp;nbsp; Does it approximately something like the following?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat COL1 $30.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input COL1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;+3+4+5&lt;/P&gt;&lt;P&gt;+2&lt;/P&gt;&lt;P&gt;+1+2+3+4+5&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select max(countc(COL1,'+')) into : nummer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from have;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array CO{&amp;amp;nummer.} $50.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; L=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do while (scan(COL1,L,'+') ne "");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CO{L} = scan(COL1,L,'+');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;L+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 12:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/creating-array-for-each-row-based-on-a-count/m-p/38087#M9719</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-07-28T12:59:08Z</dc:date>
    </item>
    <item>
      <title>creating array for each row based on a count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/creating-array-for-each-row-based-on-a-count/m-p/38088#M9720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; well i gues it solves my problem, as i want to make sure of the exact number of CO (columns). But after all it is a dataset so the maximum is OK for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But is there a way to make a different Nummer for each single row in my dataset because now i always count to the max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 13:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/creating-array-for-each-row-based-on-a-count/m-p/38088#M9720</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2011-07-28T13:08:02Z</dc:date>
    </item>
    <item>
      <title>creating array for each row based on a count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/creating-array-for-each-row-based-on-a-count/m-p/38089#M9721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As long as you initially set the array high enough to capture all values, there are numerous ways to limit the number of iterations.&lt;/P&gt;&lt;P&gt;For example, the method I used, the method you originall used, a slight variant of that method:&lt;/P&gt;&lt;P&gt;do l=1 to countc(COL1,'+');&lt;/P&gt;&lt;P&gt;and many others.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two things to note: the array dimensions are set just once and you can't access a macro variable you create from within the datastep it is created.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 13:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/creating-array-for-each-row-based-on-a-count/m-p/38089#M9721</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-07-28T13:13:14Z</dc:date>
    </item>
    <item>
      <title>creating array for each row based on a count</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/creating-array-for-each-row-based-on-a-count/m-p/38090#M9722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just write as &lt;/P&gt;&lt;P&gt;array CO{nr} $50.;&lt;/P&gt;&lt;P&gt;cann't it work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or use a data _null_ before your data step to make a macro variable "call symputx(....)",&lt;/P&gt;&lt;P&gt;then use this macro variable to instead of 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 05:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/creating-array-for-each-row-based-on-a-count/m-p/38090#M9722</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-08-03T05:21:01Z</dc:date>
    </item>
  </channel>
</rss>

