<?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: Pin Change in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Pin-Change/m-p/259704#M50267</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What have you tried?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Posting your requirements without any code or attempt makes it seem like you're asking someone to do your work...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Mar 2016 14:59:52 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-03-29T14:59:52Z</dc:date>
    <item>
      <title>Pin Change</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pin-Change/m-p/259688#M50260</link>
      <description>&lt;P&gt;&lt;BR /&gt;Acct &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; last_updt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cd &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Output&lt;BR /&gt;371520005 WKCQM0349867533 9/23/2011 &amp;nbsp; &amp;nbsp; &amp;nbsp;X00&lt;BR /&gt;371520005 WKCQM0349867533 1/26/2014 &amp;nbsp; &amp;nbsp; X01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; change&lt;BR /&gt;371520005 WKCQM0349867533 1/26/2014 &amp;nbsp; &amp;nbsp; &amp;nbsp;X00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;change&lt;BR /&gt;371520005 010488909014X99 &amp;nbsp; &amp;nbsp; &amp;nbsp;1/8/2016 &amp;nbsp; &amp;nbsp; &amp;nbsp; X97 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;change&lt;BR /&gt;371520005 010488909014X99 &amp;nbsp; &amp;nbsp; 1/10/2016 &amp;nbsp; &amp;nbsp; &amp;nbsp;X20 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; No change&lt;BR /&gt;371520005 010488909014X99 &amp;nbsp; &amp;nbsp; 1/10/2016 &amp;nbsp; &amp;nbsp; &amp;nbsp; X01&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;No change&lt;BR /&gt;371520005 WKCQM0349867533 &amp;nbsp; 1/10/2016 &amp;nbsp; &amp;nbsp; X00 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; change&lt;BR /&gt;371520005 010488909014X99 &amp;nbsp; &amp;nbsp; &amp;nbsp;1/10/2016 &amp;nbsp; &amp;nbsp; &amp;nbsp; X97 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; change&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An account will have their pin updated.&lt;/P&gt;&lt;P&gt;if the first five characters of PIN is alpha then it is a valid pin, if not Invalid pin.&lt;/P&gt;&lt;P&gt;if combination of valid pin and cd is different from top row then there is a change (row1 and row2)&lt;/P&gt;&lt;P&gt;if there is change from valid Pin to invalid pin then there is change(row3 and row4)&lt;/P&gt;&lt;P&gt;if there is change in invalid pin and cd between rows then no change (row 4 and row5 and row5 and row6)&lt;/P&gt;&lt;P&gt;how to get summarized stats for an account:&lt;BR /&gt;No of Changes:5&lt;BR /&gt;No of distinct identifiers :2 (WKCQM0349867533 and 010488909014X99)&lt;/P&gt;&lt;P&gt;Distinct No of Invalid Pins:1 (010488909014X99)&lt;/P&gt;&lt;P&gt;Distinct No of Valid Pins:1 (WKCQM0349867533)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 14:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pin-Change/m-p/259688#M50260</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2016-03-29T14:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Pin Change</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pin-Change/m-p/259704#M50267</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What have you tried?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Posting your requirements without any code or attempt makes it seem like you're asking someone to do your work...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 14:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pin-Change/m-p/259704#M50267</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-29T14:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Pin Change</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pin-Change/m-p/259714#M50272</link>
      <description>&lt;P&gt;Tried this but doesnt seem to work as expected:&lt;/P&gt;&lt;P&gt;data test1;&lt;BR /&gt;set test;&lt;BR /&gt;if anydigit(substr(pin,1,1))=1 then pin_ver='Digit';&lt;BR /&gt;else pin_ver='Alpha';&lt;BR /&gt;if pin_ver='Alpha' and cats(pin,cd)=lag(cats(pin,cd) then chng='No Change';&lt;BR /&gt;else chng='Change';&lt;BR /&gt;if pin_ver='Digit' and pin=lag(pin) then chng='No Change';&lt;BR /&gt;else chng='Change';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 15:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pin-Change/m-p/259714#M50272</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2016-03-29T15:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Pin Change</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pin-Change/m-p/259730#M50280</link>
      <description>&lt;P&gt;Break your problem up and try each one at a time.&lt;/P&gt;
&lt;P&gt;Your first requirement is 5 characters are alpha, so why does your substr formula look at only the first digit?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, post what your output should be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use LAG to compare to the previous row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look at RETAIN for carrying values down through the ID.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 15:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pin-Change/m-p/259730#M50280</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-29T15:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pin Change</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pin-Change/m-p/259734#M50282</link>
      <description>&lt;P&gt;Lag and Dif are occasionally wonderful functions but understanding the value streams takes some work. Generally you will be much better off creating unconditional temporary variables (you drop them from the data set later) such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lpin=lag(pin);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And use Lpin in your comparisons instead.&lt;/P&gt;
&lt;P&gt;If pin = Lpin then do ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And how does this affect your earlier question on "flip flop" of pin values?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 15:58:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pin-Change/m-p/259734#M50282</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-03-29T15:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Pin Change</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pin-Change/m-p/259737#M50284</link>
      <description>&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ballardw,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Pin change will be super set of flip flop. Once the pin changes are identified there are some addistional rules to be plugged in to see flip flop criteria.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2016 15:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pin-Change/m-p/259737#M50284</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2016-03-29T15:37:24Z</dc:date>
    </item>
  </channel>
</rss>

