<?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 customers who never order anything with data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/customers-who-never-order-anything-with-data-step/m-p/494401#M130268</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suppose that a website contains two tables, the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;Customers&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;table and the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;Orders&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;table. Use data step&amp;nbsp;to find all customers who never order anything.&lt;/P&gt;&lt;P&gt;Table:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;Customers&lt;/CODE&gt;.&lt;/P&gt;&lt;PRE&gt;+----+-------+
| Id | Name  |
+----+-------+
| 1  | Joe   |
| 2  | Henry |
| 3  | Sam   |
| 4  | Max   |
+----+-------+&lt;/PRE&gt;&lt;P&gt;Table:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;Orders&lt;/CODE&gt;.&lt;/P&gt;&lt;PRE&gt;+----+------------+
| Id | CustomerId |
+----+------------+
| 1  | 3          |
| 2  | 1          |
+----+------------+&lt;/PRE&gt;&lt;P&gt;Using the above tables as example, return the following:&lt;/P&gt;&lt;PRE&gt;+-----------+
| Customers |
+-----------+
| Henry     |
| Max       |
+-----------+&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Sep 2018 06:15:47 GMT</pubDate>
    <dc:creator>ccnky123</dc:creator>
    <dc:date>2018-09-11T06:15:47Z</dc:date>
    <item>
      <title>customers who never order anything with data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/customers-who-never-order-anything-with-data-step/m-p/494401#M130268</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suppose that a website contains two tables, the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;Customers&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;table and the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;Orders&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;table. Use data step&amp;nbsp;to find all customers who never order anything.&lt;/P&gt;&lt;P&gt;Table:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;Customers&lt;/CODE&gt;.&lt;/P&gt;&lt;PRE&gt;+----+-------+
| Id | Name  |
+----+-------+
| 1  | Joe   |
| 2  | Henry |
| 3  | Sam   |
| 4  | Max   |
+----+-------+&lt;/PRE&gt;&lt;P&gt;Table:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;Orders&lt;/CODE&gt;.&lt;/P&gt;&lt;PRE&gt;+----+------------+
| Id | CustomerId |
+----+------------+
| 1  | 3          |
| 2  | 1          |
+----+------------+&lt;/PRE&gt;&lt;P&gt;Using the above tables as example, return the following:&lt;/P&gt;&lt;PRE&gt;+-----------+
| Customers |
+-----------+
| Henry     |
| Max       |
+-----------+&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 06:15:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/customers-who-never-order-anything-with-data-step/m-p/494401#M130268</guid>
      <dc:creator>ccnky123</dc:creator>
      <dc:date>2018-09-11T06:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: customers who never order anything with data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/customers-who-never-order-anything-with-data-step/m-p/494403#M130269</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data customer;
input customer_id name$;
cards;
1   Joe   
2   Henry 
3   Sam   
4   Max   
;


data orders;
input id customer_id;
cards;
1   3
2   1
;

proc sql;
create table want as select a.* from customer as a where a.customer_id not in (select customer_id from orders);
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Sep 2018 06:31:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/customers-who-never-order-anything-with-data-step/m-p/494403#M130269</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2018-09-11T06:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: customers who never order anything with data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/customers-who-never-order-anything-with-data-step/m-p/494408#M130271</link>
      <description>&lt;P&gt;do like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data customer;
input customer_id name$;
cards;
1   Joe   
2   Henry 
3   Sam   
4   Max   
;

data orders;
input id customer_id;
cards;
1   3
2   1
;

proc sort data=customer;by customer_id;run;
proc sort data=orders;by customer_id;run;

data want(keep=name);
   merge customer orders(in=ino);
   by customer_id;
   if not ino;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Sep 2018 06:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/customers-who-never-order-anything-with-data-step/m-p/494408#M130271</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-09-11T06:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: customers who never order anything with data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/customers-who-never-order-anything-with-data-step/m-p/494409#M130272</link>
      <description>&lt;P&gt;Alternatively by merge step&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=customer;
by customer_id;
run;

proc sort data=orders;
by customer_id;
run;


data want;
merge customer(in=a) orders(in=b);
by customer_id ;
if a and not b ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Sep 2018 06:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/customers-who-never-order-anything-with-data-step/m-p/494409#M130272</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2018-09-11T06:42:56Z</dc:date>
    </item>
  </channel>
</rss>

