<?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 Array in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Array/m-p/36719#M9295</link>
    <description>i wnat the count when 0 has occured in these month from jan to jun&lt;BR /&gt;
&lt;BR /&gt;
data l;&lt;BR /&gt;
input jan feb mar apr may jun;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 2 3 4 5 0&lt;BR /&gt;
9 8 7 0 6 5&lt;BR /&gt;
4 5 2 5 0 9&lt;BR /&gt;
9 0 9 8 7 6&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
output &lt;BR /&gt;
 jan feb mar apr may jun tot&lt;BR /&gt;
1 2 3 4 5 0  1&lt;BR /&gt;
9 8 7 0 6 5  3&lt;BR /&gt;
4 5 2 5 0 9  2&lt;BR /&gt;
9 0 9 8 7 6  5&lt;BR /&gt;
&lt;BR /&gt;
bcuse the 0 has occured in the dofferenct positions in first tot is 1 bcse it has occured in the first postion like that i want.</description>
    <pubDate>Thu, 17 Jun 2010 09:52:38 GMT</pubDate>
    <dc:creator>sas_</dc:creator>
    <dc:date>2010-06-17T09:52:38Z</dc:date>
    <item>
      <title>Array</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array/m-p/36719#M9295</link>
      <description>i wnat the count when 0 has occured in these month from jan to jun&lt;BR /&gt;
&lt;BR /&gt;
data l;&lt;BR /&gt;
input jan feb mar apr may jun;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 2 3 4 5 0&lt;BR /&gt;
9 8 7 0 6 5&lt;BR /&gt;
4 5 2 5 0 9&lt;BR /&gt;
9 0 9 8 7 6&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
output &lt;BR /&gt;
 jan feb mar apr may jun tot&lt;BR /&gt;
1 2 3 4 5 0  1&lt;BR /&gt;
9 8 7 0 6 5  3&lt;BR /&gt;
4 5 2 5 0 9  2&lt;BR /&gt;
9 0 9 8 7 6  5&lt;BR /&gt;
&lt;BR /&gt;
bcuse the 0 has occured in the dofferenct positions in first tot is 1 bcse it has occured in the first postion like that i want.</description>
      <pubDate>Thu, 17 Jun 2010 09:52:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array/m-p/36719#M9295</guid>
      <dc:creator>sas_</dc:creator>
      <dc:date>2010-06-17T09:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Array</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array/m-p/36720#M9296</link>
      <description>Please try codes below, &lt;BR /&gt;
&lt;BR /&gt;
data have;&lt;BR /&gt;
input jan feb mar apr may jun;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 2 3 4 5 0&lt;BR /&gt;
9 8 7 0 6 5&lt;BR /&gt;
4 5 2 5 0 9&lt;BR /&gt;
9 0 9 8 7 6&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data want(drop = i);&lt;BR /&gt;
set have;&lt;BR /&gt;
array mth _numeric_;&lt;BR /&gt;
do i = 1 to dim(mth);&lt;BR /&gt;
  if mth(i) = 0 then tot = dim(mth)- i + 1;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
cheers, &lt;BR /&gt;
P.J</description>
      <pubDate>Thu, 17 Jun 2010 13:10:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array/m-p/36720#M9296</guid>
      <dc:creator>P_J</dc:creator>
      <dc:date>2010-06-17T13:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Array</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array/m-p/36721#M9297</link>
      <description>Assuming all the numbers for months have only 1 digit the following would work as well:&lt;BR /&gt;
&lt;BR /&gt;
data have;&lt;BR /&gt;
input jan feb mar apr may jun;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 2 3 4 5 0&lt;BR /&gt;
9 8 7 0 6 5&lt;BR /&gt;
4 5 2 5 0 9&lt;BR /&gt;
9 0 9 8 7 6&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data want;&lt;BR /&gt;
  set have;&lt;BR /&gt;
  tot=find(cats(jun,may,apr,mar,feb,jan),'0');&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=want noobs;&lt;BR /&gt;
run;</description>
      <pubDate>Fri, 18 Jun 2010 12:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array/m-p/36721#M9297</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-06-18T12:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Array</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array/m-p/36722#M9298</link>
      <description>The WHICHN function may be helpful, if the numbers are not single digits.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data have;&lt;BR /&gt;
   input jan feb mar apr may jun;&lt;BR /&gt;
   cards;&lt;BR /&gt;
1 2 3 4 5 0&lt;BR /&gt;
9 8 77 0 6 51&lt;BR /&gt;
4 5 32 5 0 99&lt;BR /&gt;
9 0 99 8 7 6&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data want;&lt;BR /&gt;
   set have;&lt;BR /&gt;
   array _m&lt;LI&gt; jun may apr mar feb jan;&lt;BR /&gt;
   tot=find(cats(jun,may,apr,mar,feb,jan),'0');&lt;BR /&gt;
   _0 = whichN(0,of _m&lt;/LI&gt;&lt;LI&gt;);&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
   run;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]&lt;/LI&gt;</description>
      <pubDate>Fri, 18 Jun 2010 17:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array/m-p/36722#M9298</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-06-18T17:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Array</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array/m-p/36723#M9299</link>
      <description>After Patrick'code .&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data have;&lt;BR /&gt;
input jan feb mar apr may jun;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 2 3 4 5 0&lt;BR /&gt;
9 8 7 0 6 5&lt;BR /&gt;
4 5 2 5 0 9&lt;BR /&gt;
9 0 9 8 7 6&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data want;&lt;BR /&gt;
set have;&lt;BR /&gt;
tot=indexc(cats(jan,feb,mar,apr,may,jun),'0',-1);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=want noobs;&lt;BR /&gt;
run; &lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Sat, 19 Jun 2010 10:16:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array/m-p/36723#M9299</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-06-19T10:16:10Z</dc:date>
    </item>
  </channel>
</rss>

