<?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: Multiple values in a Macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiple-values-in-a-Macro-variable/m-p/323048#M71543</link>
    <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Hi.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Remove the " around ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let med = %scan(&amp;amp;medlist, 4, ;) ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The third argument of the SCAN function is a list of characters considered to be separators, any of them will be identified as a separator.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to remove the quotes around the item use dequote function, like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let med = %sysfunc(dequote(%scan(&amp;amp;medlist, 4, ;))) ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More on the SCAN function here:&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000214639.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000214639.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel Santos&amp;nbsp;@ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Jan 2017 17:23:34 GMT</pubDate>
    <dc:creator>Daniel-Santos</dc:creator>
    <dc:date>2017-01-06T17:23:34Z</dc:date>
    <item>
      <title>Multiple values in a Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-values-in-a-Macro-variable/m-p/323047#M71542</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May you help me to check how I should correct the following Macro statements? &amp;amp;med cannot provide me the correct value. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let medlist = %str("cisplatin" ; "carboplatin"; "paclitaxel" ; "paclitaxel protein-bound" ; "pemetrexed disodium" );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%let med = %scan(&amp;amp;medlist, 4, ";") ;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%put &amp;amp;medlist &amp;amp;med ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Ivy&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2017 17:08:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-values-in-a-Macro-variable/m-p/323047#M71542</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2017-01-06T17:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple values in a Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-values-in-a-Macro-variable/m-p/323048#M71543</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Hi.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Remove the " around ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let med = %scan(&amp;amp;medlist, 4, ;) ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The third argument of the SCAN function is a list of characters considered to be separators, any of them will be identified as a separator.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to remove the quotes around the item use dequote function, like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let med = %sysfunc(dequote(%scan(&amp;amp;medlist, 4, ;))) ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More on the SCAN function here:&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000214639.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000214639.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel Santos&amp;nbsp;@ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2017 17:23:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-values-in-a-Macro-variable/m-p/323048#M71543</guid>
      <dc:creator>Daniel-Santos</dc:creator>
      <dc:date>2017-01-06T17:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple values in a Macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-values-in-a-Macro-variable/m-p/323067#M71552</link>
      <description>Thank you very much, that works !</description>
      <pubDate>Fri, 06 Jan 2017 18:43:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-values-in-a-Macro-variable/m-p/323067#M71552</guid>
      <dc:creator>Ivy</dc:creator>
      <dc:date>2017-01-06T18:43:56Z</dc:date>
    </item>
  </channel>
</rss>

