<?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: Array to null out vars in wide transaction data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Array-to-null-out-vars-in-wide-transaction-data/m-p/116800#M32214</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should work (untested) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;array purch{*} purch_:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do _n_ = 1 to dim(purch);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if upcase(vname(purch{_n_})) &amp;gt; upcase(target) then call missing(purch{_n_});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Aug 2013 22:18:42 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2013-08-20T22:18:42Z</dc:date>
    <item>
      <title>Array to null out vars in wide transaction data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-to-null-out-vars-in-wide-transaction-data/m-p/116799#M32213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried several different ways to get this to work. I can code it fine, but the current version of the code is really long and ugly. I know an array can fix it, but I cannot get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 38 monthly transaction fields labeled purch_201001 to purch_201302.&amp;nbsp; I know that some of the data is invalid.&amp;nbsp; I have a field called TARGET that identifies the last valid month of data.&amp;nbsp; IE if the last valid month for the customer was Dec 2012, then TARGET=purch_201212.&amp;nbsp; I need an array that will write over the remaining transaction fields with ".".&amp;nbsp; In the example, it would overwrite purch_201301 and purch_201302, but the TARGET varies for other customers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;written out in long form it would be... if TARGET=purch_201212 then purch_201301=. and purch_201302=.; else if TARGET=purch_201301 then purch_201302=.; etc etc for all 38 months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know it's fairly simple array... but for whatever reason, I can't get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;SS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Aug 2013 20:38:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-to-null-out-vars-in-wide-transaction-data/m-p/116799#M32213</guid>
      <dc:creator>jstuartys</dc:creator>
      <dc:date>2013-08-20T20:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Array to null out vars in wide transaction data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-to-null-out-vars-in-wide-transaction-data/m-p/116800#M32214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should work (untested) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;array purch{*} purch_:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do _n_ = 1 to dim(purch);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if upcase(vname(purch{_n_})) &amp;gt; upcase(target) then call missing(purch{_n_});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Aug 2013 22:18:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-to-null-out-vars-in-wide-transaction-data/m-p/116800#M32214</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-08-20T22:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Array to null out vars in wide transaction data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-to-null-out-vars-in-wide-transaction-data/m-p/116801#M32215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect!&amp;nbsp; Just had to make a small adjustment missing TARGETs and its working great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Aug 2013 23:52:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-to-null-out-vars-in-wide-transaction-data/m-p/116801#M32215</guid>
      <dc:creator>jstuartys</dc:creator>
      <dc:date>2013-08-20T23:52:01Z</dc:date>
    </item>
  </channel>
</rss>

