<?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: Create a dataset with records which has multiple transaction in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487099#M126859</link>
    <description>&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;create table data_set_new as&lt;/P&gt;&lt;P&gt;SELECT id, CustomerName,TransactionDate , COUNT(1) AS Cnt&lt;BR /&gt;FROM&amp;nbsp;data_set&lt;BR /&gt;GROUP BY CustomerName&amp;nbsp;&lt;BR /&gt;HAVING Cnt &amp;gt; 1&lt;BR /&gt;ORDER BY Cnt DESC;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Aug 2018 17:56:09 GMT</pubDate>
    <dc:creator>shenghuani</dc:creator>
    <dc:date>2018-08-15T17:56:09Z</dc:date>
    <item>
      <title>Create a dataset with records which has multiple transaction</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487041#M126828</link>
      <description>&lt;P&gt;I have&amp;nbsp; a dataset with 3 columns . For ex--&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Id CustomerName&amp;nbsp; TransactionDate&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp;Mayank&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10 aug 2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;2&amp;nbsp; Mayank&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11 aug 2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;3 Akhil&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10 aug 2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;4 Neha&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20 aug 2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;5 Abhi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 23 aug 2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;6 Neha&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30 may 2017&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create dataset with datasteps from this dataset where customer has done multiple transaction like (Mayank , Neha) but not (AKhil , Abhi).&lt;/P&gt;&lt;P&gt;So Result should be--&lt;/P&gt;&lt;P&gt;Id CustomerName&amp;nbsp; TransactionDate&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;1&amp;nbsp; &amp;nbsp;Mayank&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10 aug 2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;2&amp;nbsp; Mayank&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11 aug 2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;4 Neha&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20 aug 2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;6 Neha&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30 may 2017&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 15:33:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487041#M126828</guid>
      <dc:creator>Vibcom</dc:creator>
      <dc:date>2018-08-15T15:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create a dataset with records which has multiple transaction</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487053#M126832</link>
      <description>&lt;P&gt;Is there a rule for excluding the record or just a few specific ones you don't want.&lt;/P&gt;
&lt;P&gt;If just a few specific are to be removed or ignored&lt;/P&gt;
&lt;PRE&gt;data want;
   set have 
   if customername not in ('Akhil' 'Abhi');
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Aug 2018 15:57:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487053#M126832</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-15T15:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create a dataset with records which has multiple transaction</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487057#M126835</link>
      <description>&lt;P&gt;Use PROC SORT to re-order the observations:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;by CustomerName;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can select those with more than one observation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;by CustomerName;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;if first.CustomerName=1 and last.CustomerName=1 then delete;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are ways to do this in one step with PROC SQL, but I'm more familiar with a DATA step.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 16:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487057#M126835</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-15T16:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Create a dataset with records which has multiple transaction</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487083#M126850</link>
      <description>it is not specific for some names..</description>
      <pubDate>Wed, 15 Aug 2018 17:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487083#M126850</guid>
      <dc:creator>Vibcom</dc:creator>
      <dc:date>2018-08-15T17:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create a dataset with records which has multiple transaction</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487085#M126852</link>
      <description>Thanks. It solved the problem.</description>
      <pubDate>Wed, 15 Aug 2018 17:32:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487085#M126852</guid>
      <dc:creator>Vibcom</dc:creator>
      <dc:date>2018-08-15T17:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create a dataset with records which has multiple transaction</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487099#M126859</link>
      <description>&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;create table data_set_new as&lt;/P&gt;&lt;P&gt;SELECT id, CustomerName,TransactionDate , COUNT(1) AS Cnt&lt;BR /&gt;FROM&amp;nbsp;data_set&lt;BR /&gt;GROUP BY CustomerName&amp;nbsp;&lt;BR /&gt;HAVING Cnt &amp;gt; 1&lt;BR /&gt;ORDER BY Cnt DESC;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 17:56:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487099#M126859</guid>
      <dc:creator>shenghuani</dc:creator>
      <dc:date>2018-08-15T17:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create a dataset with records which has multiple transaction</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487763#M127113</link>
      <description>Thanks ...your solution also can work.</description>
      <pubDate>Fri, 17 Aug 2018 13:52:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-records-which-has-multiple-transaction/m-p/487763#M127113</guid>
      <dc:creator>Vibcom</dc:creator>
      <dc:date>2018-08-17T13:52:45Z</dc:date>
    </item>
  </channel>
</rss>

