<?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: macro variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-variables/m-p/30833#M5911</link>
    <description>I think you want to move the SQL bit into the GETDATA macro.&lt;BR /&gt;
&lt;BR /&gt;
%macro getdata;&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint; &lt;BR /&gt;
select count(*) into:NumberEdcCd from RF300L3.edc_cd where col_ins_id = "&amp;amp;sel_col_ins_id";quit;&lt;BR /&gt;
%if  &amp;amp;NumberEdcCd = 0 %then %do:&lt;BR /&gt;
&lt;BR /&gt;
   proc sql noprint; select count(*) into:NumberEdcThick from RF300L3.edc_thick   where col_ins_id = "&amp;amp;sel_col_ins_id";quit;&lt;BR /&gt;
&lt;BR /&gt;
%if &amp;amp;NumberEdcThick &amp;gt;0 %then %do;&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint; select count(*) into:NumberEdcTxrF from RF300L3.edc_txrf where col_ins_id = "&amp;amp;sel_col_ins_id";quit;&lt;BR /&gt;
%end;/*NumberEdcThick*/&lt;BR /&gt;
%end;/*NumberEdcCd */&lt;BR /&gt;
&lt;BR /&gt;
/* rest of code*/</description>
    <pubDate>Thu, 02 Jun 2011 18:14:55 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2011-06-02T18:14:55Z</dc:date>
    <item>
      <title>macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variables/m-p/30831#M5909</link>
      <description>Hello, i'm running a stored process which includes the following code: First i look in which of the three tables my col_ins_id is situated in. Afterwards i use the variables in a macro. This works nice but now i want to gain some time.&lt;BR /&gt;
&lt;BR /&gt;
 For example if I Find my ID in the first table, i don't want to count the other 2?&lt;BR /&gt;
 For example if I Find my ID in the second table, i don't want to count the third..&lt;BR /&gt;
&lt;BR /&gt;
Greets&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint; &lt;BR /&gt;
select count(*) into:NumberEdcCd from RF300L3.edc_cd where col_ins_id = "&amp;amp;sel_col_ins_id";quit;&lt;BR /&gt;
%put &amp;amp;NumberEdcCd;&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint; select count(*) into:NumberEdcThick from RF300L3.edc_thick where col_ins_id = "&amp;amp;sel_col_ins_id";quit;&lt;BR /&gt;
%put &amp;amp;NumberEdcThick;&lt;BR /&gt;
&lt;BR /&gt;
		  proc sql noprint; select count(*) into:NumberEdcTxrF from RF300L3.edc_txrf where col_ins_id = "&amp;amp;sel_col_ins_id";quit;&lt;BR /&gt;
		  %put &amp;amp;NumberEdcTxrF;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%macro getData;&lt;BR /&gt;
%if &amp;amp;NumberEdcCd &amp;gt; 0 %then %do;&lt;BR /&gt;
data out_table;&lt;BR /&gt;
set RF300L3.edc_cd;&lt;BR /&gt;
where col_ins_id = "&amp;amp;sel_col_ins_id";&lt;BR /&gt;
run;&lt;BR /&gt;
%end;&lt;BR /&gt;
%else %if &amp;amp;NumberEdcThick &amp;gt; 0 %then %do;&lt;BR /&gt;
data out_table;&lt;BR /&gt;
set RF300L3.edc_thick;&lt;BR /&gt;
where col_ins_id = "&amp;amp;sel_col_ins_id";&lt;BR /&gt;
run;&lt;BR /&gt;
%end;&lt;BR /&gt;
%else %if &amp;amp;NumberEdcTxrF &amp;gt; 0 %then %do;&lt;BR /&gt;
data out_table;&lt;BR /&gt;
set RF300L3.edc_txrf;&lt;BR /&gt;
where col_ins_id = "&amp;amp;sel_col_ins_id";&lt;BR /&gt;
run;&lt;BR /&gt;
%end;&lt;BR /&gt;
%else %extract_edc_full(pInProcess WaferId User_id State Slot ROW_ID ProcessRecipe ProcessPlan PmProcedure MeasRecipe &lt;BR /&gt;
					MeasKey MainTool LotId LimitsKey InspectionTool Facility DuploWaferId Datim CustomKey &lt;BR /&gt;
					ChecklistActivityId CSIM_TIMESTAMP COL_INS_ID, out_table);&lt;BR /&gt;
%mend;&lt;BR /&gt;
%getData;</description>
      <pubDate>Wed, 16 Mar 2011 07:51:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variables/m-p/30831#M5909</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2011-03-16T07:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variables/m-p/30832#M5910</link>
      <description>Not sure what you're asking here....???</description>
      <pubDate>Thu, 02 Jun 2011 16:26:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variables/m-p/30832#M5910</guid>
      <dc:creator>PatrickG</dc:creator>
      <dc:date>2011-06-02T16:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-variables/m-p/30833#M5911</link>
      <description>I think you want to move the SQL bit into the GETDATA macro.&lt;BR /&gt;
&lt;BR /&gt;
%macro getdata;&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint; &lt;BR /&gt;
select count(*) into:NumberEdcCd from RF300L3.edc_cd where col_ins_id = "&amp;amp;sel_col_ins_id";quit;&lt;BR /&gt;
%if  &amp;amp;NumberEdcCd = 0 %then %do:&lt;BR /&gt;
&lt;BR /&gt;
   proc sql noprint; select count(*) into:NumberEdcThick from RF300L3.edc_thick   where col_ins_id = "&amp;amp;sel_col_ins_id";quit;&lt;BR /&gt;
&lt;BR /&gt;
%if &amp;amp;NumberEdcThick &amp;gt;0 %then %do;&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint; select count(*) into:NumberEdcTxrF from RF300L3.edc_txrf where col_ins_id = "&amp;amp;sel_col_ins_id";quit;&lt;BR /&gt;
%end;/*NumberEdcThick*/&lt;BR /&gt;
%end;/*NumberEdcCd */&lt;BR /&gt;
&lt;BR /&gt;
/* rest of code*/</description>
      <pubDate>Thu, 02 Jun 2011 18:14:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-variables/m-p/30833#M5911</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2011-06-02T18:14:55Z</dc:date>
    </item>
  </channel>
</rss>

