<?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: Using the let statement to call later in a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148351#M29345</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are getting the error because of this (this is what the compiler sees after macro decoded):&lt;/P&gt;&lt;P&gt;if index(upcase(GENERIC),('drug_a' 'drug_b')) &amp;gt;0 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see from the above this is not how the index function works so you get the errors.&lt;/P&gt;&lt;P&gt;You could update the macro to loop over the macro using %scan to get each one out.&amp;nbsp; Its a bit of a faff though.&amp;nbsp; Might I ask what you are trying to achieve as I would assume there are better solutions than using a macro variable - for instance you are going to hit the maximum length quickly.&lt;/P&gt;&lt;P&gt;One suggestion is:&lt;/P&gt;&lt;P&gt;data drugs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drug="Drug A"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drug="Drug B"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drug="Drug C"; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set drugs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('data '||strip(drug)||';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if index(upcase(GENERIC),'||strip(drug)||') &amp;gt;0 ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&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;&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; run;');&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;This will generate a datastep for each row in drugs with the condition to output if generic in have has the word from the dataset drug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Other alternatives can be had depending on scenario. &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Just to add on the above data _null_ method, the drugs dataset can be separate from the data, updated as and when, and also be any size without changing the main program.&amp;nbsp; For instance if you hardcode your drug list, then you need to update the program if any new drugs are added etc. With this you could for instance use ATC Coding datasets. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 May 2014 12:30:17 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2014-05-07T12:30:17Z</dc:date>
    <item>
      <title>Using the let statement to call later in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148348#M29342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following let statement as I want to create a macro data step rather than having to individually call out each drug name&amp;nbsp; in a separate line of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let drug = ( 'CARBOPLATIN'&amp;nbsp; 'ABARELIX ABS'&amp;nbsp; 'ABIRATERONE'&amp;nbsp; 'AFINTONIB' 'ALDESLEUKIN' )&amp;nbsp; ***and about 100 more drugs which i haven't listed)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data x;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set y;&lt;/P&gt;&lt;P&gt; if index(upcase(GENERIC),&amp;amp;drug) &amp;gt;0 ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; However I keep getting the following error message.&amp;nbsp; I can't figure out where I am going wrong.&amp;nbsp; Any suggestions would be great .&amp;nbsp;&amp;nbsp; Just to note i tried indexW and got the same error. thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the macro variable "drug".&lt;/P&gt;&lt;P&gt;640&amp;nbsp; ( 'CARBOPLATIN'&amp;nbsp; 'ABARELIX ABS'&amp;nbsp; 'ABIRATERONE'&amp;nbsp; 'AFINTONIB'&amp;nbsp; 'ALDESLEUKIN')&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 388&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;ERROR 388-185: Expecting an arithmetic operator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 11:21:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148348#M29342</guid>
      <dc:creator>lisahoward</dc:creator>
      <dc:date>2014-05-07T11:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using the let statement to call later in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148349#M29343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%let drug =&amp;nbsp; 'CARBOPLATIN ABARELIX ABS ABIRATERONE&amp;nbsp; AFINTONIB ALDESLEUKIN'; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data x;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;y=&amp;nbsp; indexw(&amp;amp;drug,"ABARELIX")&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 11:50:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148349#M29343</guid>
      <dc:creator>TarunKumar</dc:creator>
      <dc:date>2014-05-07T11:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using the let statement to call later in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148350#M29344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I am not sure the above would work as they are all different drugs in the % let statement. and in the datastep you are still calling out each drug e..g. &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ABARELIX&lt;/SPAN&gt;.&amp;nbsp; What i am ultimately trying to do is not repeat the same datastep for every single drug type as there are over 100 so for example how can i&amp;nbsp; get the following three steps in to one step that calls the drug name as a macro variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to make a macro out of the following statement.&amp;nbsp; Here we just have two drugs so don't need a macro but in my program there are over a 100 drugs.&amp;nbsp; I want to put the drugs in a let statement to call throughout my program.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Currently&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;data x ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set y;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if&amp;nbsp; index(upcase(GENERIC_NAME),'drug_a')&amp;gt;0 or &lt;/P&gt;&lt;P&gt;&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;&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; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&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; index(upcase(GENERIC_NAME),'drug_b')&amp;gt;0) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Trying to change it to:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%let drug=('drug_a' 'drug_b');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data x;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; set y;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if index(upcase(GENERIC),&amp;amp;drug) &amp;gt;0 ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;but i get the error:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ERROR 388-185: Expecting an arithmetic operator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 12:16:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148350#M29344</guid>
      <dc:creator>lisahoward</dc:creator>
      <dc:date>2014-05-07T12:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using the let statement to call later in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148351#M29345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are getting the error because of this (this is what the compiler sees after macro decoded):&lt;/P&gt;&lt;P&gt;if index(upcase(GENERIC),('drug_a' 'drug_b')) &amp;gt;0 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see from the above this is not how the index function works so you get the errors.&lt;/P&gt;&lt;P&gt;You could update the macro to loop over the macro using %scan to get each one out.&amp;nbsp; Its a bit of a faff though.&amp;nbsp; Might I ask what you are trying to achieve as I would assume there are better solutions than using a macro variable - for instance you are going to hit the maximum length quickly.&lt;/P&gt;&lt;P&gt;One suggestion is:&lt;/P&gt;&lt;P&gt;data drugs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drug="Drug A"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drug="Drug B"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drug="Drug C"; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set drugs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('data '||strip(drug)||';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if index(upcase(GENERIC),'||strip(drug)||') &amp;gt;0 ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&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;&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; run;');&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;This will generate a datastep for each row in drugs with the condition to output if generic in have has the word from the dataset drug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Other alternatives can be had depending on scenario. &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Just to add on the above data _null_ method, the drugs dataset can be separate from the data, updated as and when, and also be any size without changing the main program.&amp;nbsp; For instance if you hardcode your drug list, then you need to update the program if any new drugs are added etc. With this you could for instance use ATC Coding datasets. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 12:30:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148351#M29345</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-07T12:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using the let statement to call later in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148352#M29346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you RW9. Basically I am just trying to get a dataset with all patients that have a record of the drugs specified and leave the rest of the unspecified drugs behind. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 12:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148352#M29346</guid>
      <dc:creator>lisahoward</dc:creator>
      <dc:date>2014-05-07T12:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using the let statement to call later in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148353#M29347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I would just code that in then:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table WANT as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PATIENT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HAVE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DRUG in ('Drug A','Drug B','Drug C');&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 12:47:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148353#M29347</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-05-07T12:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using the let statement to call later in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148354#M29348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lisa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The real problem is that INDEX is the wrong tool for the job.&amp;nbsp; You could use your original %LET statement (which includes parentheses around the quoted names) in this fashion:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if upcase(GENERIC) in &amp;amp;drug;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 13:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-let-statement-to-call-later-in-a-macro/m-p/148354#M29348</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-05-07T13:15:53Z</dc:date>
    </item>
  </channel>
</rss>

