<?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: programming help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/413573#M101252</link>
    <description>&lt;P&gt;You are not really referencing anything in your array, but your entire array itself.&amp;nbsp;I'm guessing you want&amp;nbsp;to reference the i'th instance of your k1 array, so your line inside your do loop&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if k1=1 then n1=n1+1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;should be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if k1[i]=1 then n1=n1+1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;since right now, you are not using your i variable at all &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Nov 2017 06:43:00 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2017-11-15T06:43:00Z</dc:date>
    <item>
      <title>programming help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/413572#M101251</link>
      <description>&lt;P&gt;Could anyone tell me what's wrong with this program?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data a.new1;&lt;BR /&gt;set a.new;&lt;BR /&gt;n1=0;&lt;BR /&gt;array k1 {16} k1get k2get k3get k4get k5get k6get k7get k8get k9get k10get k11get k12get k13get k14get k15get k16get;&lt;BR /&gt;do i = 1 to 16;&lt;BR /&gt;if k1=1 then n1=n1+1;&lt;BR /&gt;end;&lt;BR /&gt;drop i;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because an error showed up&lt;/P&gt;&lt;P&gt;"Illegal reference to the array k1."&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 06:25:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/413572#M101251</guid>
      <dc:creator>VirginiaGo</dc:creator>
      <dc:date>2017-11-15T06:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: programming help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/413573#M101252</link>
      <description>&lt;P&gt;You are not really referencing anything in your array, but your entire array itself.&amp;nbsp;I'm guessing you want&amp;nbsp;to reference the i'th instance of your k1 array, so your line inside your do loop&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if k1=1 then n1=n1+1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;should be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if k1[i]=1 then n1=n1+1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;since right now, you are not using your i variable at all &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 06:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/413573#M101252</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-11-15T06:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: programming help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/413723#M101292</link>
      <description>&lt;P&gt;And a good example of possibly rethinking variable names. If you had named the variables Kget1 to Kget16 or GetK1 to GetK16&amp;nbsp;you could reference them in the array statement as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;array k1 Kget1-Kget16; or Array k1 GetK1-GetK16;&lt;/P&gt;
&lt;P&gt;or if that is all of the "get" variables&lt;/P&gt;
&lt;P&gt;array k1 Kget: ;&amp;nbsp;&amp;nbsp; or array k1 GetK: ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 16:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/programming-help/m-p/413723#M101292</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-11-15T16:19:48Z</dc:date>
    </item>
  </channel>
</rss>

