<?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: Scan macro variable list with names like &amp;quot;this is the first variable&amp;quot;n in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Scan-macro-variable-list-with-names-like-quot-this-is-the-first/m-p/668962#M200606</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/319587"&gt;@alejandrogrrl&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;I was asked not to change the names of the variables.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You will curse the day on which you accepted this stupidity.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jul 2020 20:49:47 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-07-13T20:49:47Z</dc:date>
    <item>
      <title>Scan macro variable list with names like "this is the first variable"n</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-macro-variable-list-with-names-like-quot-this-is-the-first/m-p/668932#M200582</link>
      <description>&lt;P&gt;I want to run the following code. My problem is that I dont know how to put the delimiter in the scan function so that it identifies the three variables inside vars. I've tried multiple times without success (I just put "?" inside the code because that is were my question lies). I hope you can help me. Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let vars="TIIE 28 días (%)"n "TIIE 91 días (%)"n "Cetes 28 días (%)"n;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM&gt;serie&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do i=&lt;STRONG&gt;1&lt;/STRONG&gt; %to 3;&lt;/P&gt;&lt;P&gt;&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; %let parameter=%scan(&amp;amp;vars.,&amp;amp;i.,"?");&lt;/P&gt;&lt;P&gt;&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; proc sgplot data=base;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; series x=date y=&amp;amp;parameter./ markers;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 19:09:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-macro-variable-list-with-names-like-quot-this-is-the-first/m-p/668932#M200582</guid>
      <dc:creator>alejandrogrrl</dc:creator>
      <dc:date>2020-07-13T19:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Scan macro variable list with names like "this is the first variable"n</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-macro-variable-list-with-names-like-quot-this-is-the-first/m-p/668933#M200583</link>
      <description>&lt;P&gt;Use the Q modifier on the %SCAN() call.&lt;/P&gt;
&lt;PRE&gt;128  %let vars="TIIE 28 días (%)"n "TIIE 91 días (%)"n "Cetes 28 días (%)"n;
129  %put %scan(&amp;amp;vars,1,%str( ),q);
"TIIE 28 días (%)"n
130  %put %scan(&amp;amp;vars,2,%str( ),q);
"TIIE 91 días (%)"n
131  %put %scan(&amp;amp;vars,3,%str( ),q);
"Cetes 28 días (%)"n
&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Jul 2020 19:14:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-macro-variable-list-with-names-like-quot-this-is-the-first/m-p/668933#M200583</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-13T19:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Scan macro variable list with names like "this is the first variable"n</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-macro-variable-list-with-names-like-quot-this-is-the-first/m-p/668939#M200587</link>
      <description>&lt;P&gt;Since your values have default delimiters like spaces then you need to construct the variable list with a known character like a pipe character | or some other character that you will &lt;STRONG&gt;absolutely never ever &lt;/STRONG&gt; use in a variable name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let vars="TIIE 28 días (%)"n|"TIIE 91 días (%)"n|"Cetes 28 días (%)"n;

%let v1 = %scan(&amp;amp;vars,1,|);
%let v2 = %scan(&amp;amp;vars,2,|);
%let v3 = %scan(&amp;amp;vars,3,|);

%put &amp;amp;v1.;
%put &amp;amp;v2.;
%put &amp;amp;v3.;&lt;/PRE&gt;
&lt;P&gt;Please note that since the macro language uses % for functions and such you may have other issues further on. Also, inclusion of characters like comma or &amp;amp; in your variable names is extremely likely to be problematic.&lt;/P&gt;
&lt;P&gt;In the long run you would be much better off using standard variable names and use a variable LABEL to provide "nicer" text for output.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 19:21:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-macro-variable-list-with-names-like-quot-this-is-the-first/m-p/668939#M200587</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-13T19:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: Scan macro variable list with names like "this is the first variable"n</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-macro-variable-list-with-names-like-quot-this-is-the-first/m-p/668940#M200588</link>
      <description>&lt;P&gt;Thanks a lot! This is exactly what I needed. I'm really really grateful.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 19:24:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-macro-variable-list-with-names-like-quot-this-is-the-first/m-p/668940#M200588</guid>
      <dc:creator>alejandrogrrl</dc:creator>
      <dc:date>2020-07-13T19:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Scan macro variable list with names like "this is the first variable"n</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-macro-variable-list-with-names-like-quot-this-is-the-first/m-p/668942#M200589</link>
      <description>Thanks for the solution.&lt;BR /&gt;&lt;BR /&gt;I know using commas and symbols in variable names is extremely uncovenient. However, since these variables are from a public source (my central bank) I was asked not to change the names of the variables.&lt;BR /&gt;&lt;BR /&gt;Thanks again for the solution and for the tips!</description>
      <pubDate>Mon, 13 Jul 2020 19:29:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-macro-variable-list-with-names-like-quot-this-is-the-first/m-p/668942#M200589</guid>
      <dc:creator>alejandrogrrl</dc:creator>
      <dc:date>2020-07-13T19:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Scan macro variable list with names like "this is the first variable"n</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scan-macro-variable-list-with-names-like-quot-this-is-the-first/m-p/668962#M200606</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/319587"&gt;@alejandrogrrl&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;I was asked not to change the names of the variables.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You will curse the day on which you accepted this stupidity.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 20:49:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scan-macro-variable-list-with-names-like-quot-this-is-the-first/m-p/668962#M200606</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-13T20:49:47Z</dc:date>
    </item>
  </channel>
</rss>

