<?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: Using an ARRAY in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Using-an-ARRAY/m-p/177266#M45392</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I'm assuming you have more code in your data step because you indicated two output data sets, but hopefully this helps:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Data&amp;nbsp; WGTCHG(Drop=name dob marital race) DEMO(Keep=name dob marital race);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Set Wgt2.weights2;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;array change(2:11) changev2-changev11;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;array wgt(1:11) wgt1-wgt11;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;do i= 2 to 11;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;change(i)=wgt(i)-wgt(i-1);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;end;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Oct 2014 18:54:42 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-10-08T18:54:42Z</dc:date>
    <item>
      <title>Using an ARRAY</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-an-ARRAY/m-p/177265#M45391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to convert the following code to using an ARRAY(s) instead of individual entries.&lt;/P&gt;&lt;P&gt; My Current code with individual entries is as follows:&lt;/P&gt;&lt;P&gt;Data WGTCHG(Drop=name dob marital race)DEMO(Keep=name dob marital race);&lt;/P&gt;&lt;P&gt;Set Wgt2.weights2;&lt;/P&gt;&lt;P&gt;CHANGEV2=wgt2-wgt1;&lt;/P&gt;&lt;P&gt;CHANGEV3=wgt3-wgt2;&lt;/P&gt;&lt;P&gt;CHANGEV4=wgt4-wgt3;&lt;/P&gt;&lt;P&gt;CHANGEV5=wgt5-wgt4;&lt;/P&gt;&lt;P&gt;CHANGEV6=wgt6-wgt5;&lt;/P&gt;&lt;P&gt;CHANGEV7=wgt7-wgt6;&lt;/P&gt;&lt;P&gt;CHANGEV8=wgt8-wgt7;&lt;/P&gt;&lt;P&gt;CHANGEV9=wgt9-wgt8;&lt;/P&gt;&lt;P&gt;CHANGEV10=wgt10-wgt9;&lt;/P&gt;&lt;P&gt;CHNAGEV11=wgt11-wgt10;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been unsuccessful finding an example in these forums, UCLA and Stanford's SAS pages so any help would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Scouter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 18:42:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-an-ARRAY/m-p/177265#M45391</guid>
      <dc:creator>chris21baseball_hotmail_com</dc:creator>
      <dc:date>2014-10-08T18:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using an ARRAY</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-an-ARRAY/m-p/177266#M45392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I'm assuming you have more code in your data step because you indicated two output data sets, but hopefully this helps:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Data&amp;nbsp; WGTCHG(Drop=name dob marital race) DEMO(Keep=name dob marital race);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Set Wgt2.weights2;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;array change(2:11) changev2-changev11;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;array wgt(1:11) wgt1-wgt11;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;do i= 2 to 11;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;change(i)=wgt(i)-wgt(i-1);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;end;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 18:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-an-ARRAY/m-p/177266#M45392</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-10-08T18:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using an ARRAY</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-an-ARRAY/m-p/177267#M45393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had the same suggestion as Fareeza, but suggest using _n_ rather than i, or adding i do your drop variables. _n_ will automatically be dropped.&amp;nbsp; i.e.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;do _n_= 2 to 11;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;change(_n_)=wgt(_n_)-wgt(_n_-1);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 19:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-an-ARRAY/m-p/177267#M45393</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-10-08T19:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using an ARRAY</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-an-ARRAY/m-p/177268#M45394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much! I've been at it for the past 3 hours and was about ready to pull my hair out! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 19:06:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-an-ARRAY/m-p/177268#M45394</guid>
      <dc:creator>chris21baseball_hotmail_com</dc:creator>
      <dc:date>2014-10-08T19:06:20Z</dc:date>
    </item>
  </channel>
</rss>

