<?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: use macro to select one order id in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/use-macro-to-select-one-order-id/m-p/604695#M175331</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your customerId is numeric, and in the WHERE you are using "&amp;amp;id." which is character&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Make it:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where customerid = &amp;amp;id.;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2019 13:24:55 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2019-11-16T13:24:55Z</dc:date>
    <item>
      <title>use macro to select one order id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-macro-to-select-one-order-id/m-p/604693#M175329</link>
      <description>&lt;P&gt;I have the following dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data orders;&lt;BR /&gt;input customerid OrderDate DATE7. Model $13-24 Quantity;&lt;BR /&gt;cards;&lt;BR /&gt;287 15OCT03 Dealr Breeze 15&lt;BR /&gt;287 15OCT03 Sarah Ana 15&lt;BR /&gt;274 16OCT03 Gee Stream 1&lt;BR /&gt;174 17OCT03 Sarah Ana 20&lt;BR /&gt;174 17OCT03 Nor'easter 5&lt;BR /&gt;174 17OCT03 Scirocco 1&lt;BR /&gt;347 18OCT03 Mistral 1&lt;BR /&gt;287 21OCT03 Dealr Breeze 30&lt;BR /&gt;287 21OCT03 Gee Ana 25&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to write a macro called pick_order that will print a subset of the data set orders&lt;BR /&gt;for a selected customer---&amp;gt; So I wrote the following code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro pick_order (id=);
proc print data=Orders noobs;
where customerid = "&amp;amp;id.";&amp;nbsp;
title "&amp;amp;id. Orders";
run;
%mend pick_order;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;*THEN I want to run my macro I have written to print the table for customer 287;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;%pick_order (id=287);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the following error:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;ERROR: WHERE clause operator requires compatible variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any advie will be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2019 12:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-macro-to-select-one-order-id/m-p/604693#M175329</guid>
      <dc:creator>mrahouma</dc:creator>
      <dc:date>2019-11-16T12:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: use macro to select one order id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-macro-to-select-one-order-id/m-p/604695#M175331</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your customerId is numeric, and in the WHERE you are using "&amp;amp;id." which is character&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Make it:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where customerid = &amp;amp;id.;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2019 13:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-macro-to-select-one-order-id/m-p/604695#M175331</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2019-11-16T13:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: use macro to select one order id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-macro-to-select-one-order-id/m-p/604696#M175332</link>
      <description>Thanks a lot. Greatly appreciated</description>
      <pubDate>Sat, 16 Nov 2019 13:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-macro-to-select-one-order-id/m-p/604696#M175332</guid>
      <dc:creator>mrahouma</dc:creator>
      <dc:date>2019-11-16T13:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: use macro to select one order id</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-macro-to-select-one-order-id/m-p/604698#M175334</link>
      <description>&lt;P&gt;OTOH, it would be better to store the customer ID as character. You'll never do calculations with it.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2019 13:56:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-macro-to-select-one-order-id/m-p/604698#M175334</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-16T13:56:41Z</dc:date>
    </item>
  </channel>
</rss>

