<?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: How to retrieve a second transaction from a customer acc_no=100 ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-a-second-transaction-from-a-customer-acc-no-100/m-p/216279#M39866</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data a;&lt;/P&gt;&lt;P&gt;&amp;nbsp; INFILE CARDS;&lt;/P&gt;&lt;P&gt;&amp;nbsp; INPUT Acc_no @;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF Acc_no = 100;&lt;/P&gt;&lt;P&gt;&amp;nbsp; INPUT Transaction_date:DATE9. Trans_Amt;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;100 1-Jul-15 1000&lt;/P&gt;&lt;P&gt;100 2-Jul-15 2000&lt;/P&gt;&lt;P&gt;100 3-Jul-15 3000&lt;/P&gt;&lt;P&gt;100 4-Jul-15 4000&lt;/P&gt;&lt;P&gt;100 5-Jul-15 5000&lt;/P&gt;&lt;P&gt;101 6-Jul-15 6000&lt;/P&gt;&lt;P&gt;101 7-Jul-15 7000&lt;/P&gt;&lt;P&gt;101 8-Jul-15 2500&lt;/P&gt;&lt;P&gt;101 9-Jul-15 500&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA = a (FIRSTOBS =2 OBS=2);&lt;/P&gt;&lt;P&gt;&amp;nbsp; FORMAT Transaction_date DATE9.;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Aug 2015 15:15:38 GMT</pubDate>
    <dc:creator>KrisNori</dc:creator>
    <dc:date>2015-08-04T15:15:38Z</dc:date>
    <item>
      <title>How to retrieve a second transaction from a customer acc_no=100 ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-a-second-transaction-from-a-customer-acc-no-100/m-p/216276#M39863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="265"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="64"&gt;Acc_No&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;Transaction_Date&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="137"&gt;Transaction_Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;100&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;1-Jul-15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;100&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;2-Jul-15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;100&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;3-Jul-15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;3000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;100&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;4-Jul-15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;4000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;100&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;5-Jul-15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;5000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;101&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;6-Jul-15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;6000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;101&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;7-Jul-15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;7000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;101&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;8-Jul-15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20" style="border-top: none;"&gt;101&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;9-Jul-15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 07:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-a-second-transaction-from-a-customer-acc-no-100/m-p/216276#M39863</guid>
      <dc:creator>srdr1217</dc:creator>
      <dc:date>2015-08-04T07:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve a second transaction from a customer acc_no=100 ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-a-second-transaction-from-a-customer-acc-no-100/m-p/216277#M39864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sort data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by Acc_No Transaction_Date;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by Acc_No Transaction_Date;&lt;/P&gt;&lt;P&gt;retain order 0;&lt;/P&gt;&lt;P&gt;if first.Acc_no then order = 0;&lt;/P&gt;&lt;P&gt;order+1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if order = 2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 11:54:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-a-second-transaction-from-a-customer-acc-no-100/m-p/216277#M39864</guid>
      <dc:creator>AskoLötjönen</dc:creator>
      <dc:date>2015-08-04T11:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve a second transaction from a customer acc_no=100 ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-a-second-transaction-from-a-customer-acc-no-100/m-p/216278#M39865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input Acc_No Transaction_Date date8. Transaction_Amount ;&lt;BR /&gt;format Transaction_Date date9.;&lt;BR /&gt;datalines;&lt;BR /&gt;100 1-Jul-15 1000 &lt;BR /&gt;100 2-Jul-15 2000 &lt;BR /&gt;100 3-Jul-15 3000 &lt;BR /&gt;100 4-Jul-15 4000 &lt;BR /&gt;100 5-Jul-15 5000 &lt;BR /&gt;101 6-Jul-15 6000 &lt;BR /&gt;101 7-Jul-15 7000 &lt;BR /&gt;101 8-Jul-15 2500 &lt;BR /&gt;101 9-Jul-15 500 &lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have (keep=Acc_No) ;&lt;BR /&gt;by Acc_No;&lt;BR /&gt;set have(firstobs=2 drop=Acc_No);&lt;/P&gt;&lt;P&gt;if first.Acc_No;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 12:11:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-a-second-transaction-from-a-customer-acc-no-100/m-p/216278#M39865</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2015-08-04T12:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve a second transaction from a customer acc_no=100 ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-a-second-transaction-from-a-customer-acc-no-100/m-p/216279#M39866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data a;&lt;/P&gt;&lt;P&gt;&amp;nbsp; INFILE CARDS;&lt;/P&gt;&lt;P&gt;&amp;nbsp; INPUT Acc_no @;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF Acc_no = 100;&lt;/P&gt;&lt;P&gt;&amp;nbsp; INPUT Transaction_date:DATE9. Trans_Amt;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;100 1-Jul-15 1000&lt;/P&gt;&lt;P&gt;100 2-Jul-15 2000&lt;/P&gt;&lt;P&gt;100 3-Jul-15 3000&lt;/P&gt;&lt;P&gt;100 4-Jul-15 4000&lt;/P&gt;&lt;P&gt;100 5-Jul-15 5000&lt;/P&gt;&lt;P&gt;101 6-Jul-15 6000&lt;/P&gt;&lt;P&gt;101 7-Jul-15 7000&lt;/P&gt;&lt;P&gt;101 8-Jul-15 2500&lt;/P&gt;&lt;P&gt;101 9-Jul-15 500&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA = a (FIRSTOBS =2 OBS=2);&lt;/P&gt;&lt;P&gt;&amp;nbsp; FORMAT Transaction_date DATE9.;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 15:15:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-a-second-transaction-from-a-customer-acc-no-100/m-p/216279#M39866</guid>
      <dc:creator>KrisNori</dc:creator>
      <dc:date>2015-08-04T15:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve a second transaction from a customer acc_no=100 ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-a-second-transaction-from-a-customer-acc-no-100/m-p/216280#M39867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 8.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; Acc_No Transaction_Date &lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;date8.&lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; Transaction_Amount ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; Transaction_Date &lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;datalines&lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100 1-Jul-15 1000&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100 2-Jul-15 2000&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100 3-Jul-15 3000&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100 4-Jul-15 4000&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;100 5-Jul-15 5000&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;101 6-Jul-15 6000&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;101 7-Jul-15 7000&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;101 8-Jul-15 2500&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;101 9-Jul-15 500&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 8.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; Acc_No;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; lag(first.Acc_No);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;putlog&lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; Transaction_Date;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 8.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;02JUL2015&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;07JUL2015&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'SAS Monospace';"&gt;Add a where clause if you need one customer only.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 05:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-retrieve-a-second-transaction-from-a-customer-acc-no-100/m-p/216280#M39867</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2015-08-05T05:30:15Z</dc:date>
    </item>
  </channel>
</rss>

