<?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: Help with Arrays in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Arrays/m-p/119278#M24555</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you need 3 arrays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Array Q_on q1_0_on q1_1_on (continue adding until q1_12_on;&lt;/P&gt;&lt;P&gt;Array Q_ab q1_0_ab q1_1_ab&amp;nbsp; (ditto);&lt;/P&gt;&lt;P&gt;array Q q1_0 q1_1 ... q1_12;&lt;/P&gt;&lt;P&gt;do i = 1 to dim (Q);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q&lt;I&gt; = 0;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if Q_on&lt;I&gt;=1 and Q_ab&lt;I&gt;=0 then Q&lt;I&gt;=1;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if Q_on&lt;I&gt;=0 and Q_ab&lt;I&gt;=1 then Q&lt;I&gt;=-1;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;drop i;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 May 2012 17:51:25 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2012-05-17T17:51:25Z</dc:date>
    <item>
      <title>Help with Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Arrays/m-p/119277#M24554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a variable set with variables q1_0_on, q1_0_ab, q1_1_on, q1_1_ab ... etc. all the way to q1_12_on, q1_12_ab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially what i'd like to do is to recode it into a different variable with a scale (1,0,-1) with an array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;q1_0 = 0;&lt;/P&gt;&lt;P&gt;if q1_0_on=1 and q1_0_ab=0 then q1_0=1;&lt;/P&gt;&lt;P&gt;if q1_0_on=0 and q1_0_ab=1 then q1_0=-1 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i could duplicate the code above 12 times but i was hoping there's an easy way with an array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2012 17:23:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Arrays/m-p/119277#M24554</guid>
      <dc:creator>Danglytics</dc:creator>
      <dc:date>2012-05-17T17:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Arrays/m-p/119278#M24555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you need 3 arrays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Array Q_on q1_0_on q1_1_on (continue adding until q1_12_on;&lt;/P&gt;&lt;P&gt;Array Q_ab q1_0_ab q1_1_ab&amp;nbsp; (ditto);&lt;/P&gt;&lt;P&gt;array Q q1_0 q1_1 ... q1_12;&lt;/P&gt;&lt;P&gt;do i = 1 to dim (Q);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q&lt;I&gt; = 0;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if Q_on&lt;I&gt;=1 and Q_ab&lt;I&gt;=0 then Q&lt;I&gt;=1;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if Q_on&lt;I&gt;=0 and Q_ab&lt;I&gt;=1 then Q&lt;I&gt;=-1;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;drop i;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2012 17:51:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Arrays/m-p/119278#M24555</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-05-17T17:51:25Z</dc:date>
    </item>
  </channel>
</rss>

