<?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: How to pass multiple words parameters into a macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296571#M62163</link>
    <description>&lt;P&gt;&amp;nbsp;Is this really your libname? Based on the macro variable it's going to resolve to:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token macroname"&gt;%let&lt;/SPAN&gt; local_Filename &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; File1 File2 &lt;SPAN class="token string"&gt;'File3 File4'&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;n&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i=1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;libname&lt;/SPAN&gt; xlsFile XLSX &lt;SPAN class="token string"&gt;"/user/File1 only.xlsm"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;i=2&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;libname&lt;/SPAN&gt; xlsFile XLSX &lt;SPAN class="token string"&gt;"/user/File2 only.xlsm"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;i=3&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;libname&lt;/SPAN&gt; xlsFile XLSX &lt;SPAN class="token string"&gt;"/user/'File3 only.xlsm"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note the single quote and that since SCAN using space as a delimiter it uses just the File3 part.&lt;/P&gt;
&lt;P&gt;How should this be resolved.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do a similar exercise with your remaining macro variables you'll find your issues. It's tedious but how you debug.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Sep 2016 16:23:18 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-09-05T16:23:18Z</dc:date>
    <item>
      <title>How to pass multiple words parameters into a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296453#M62124</link>
      <description>&lt;P&gt;I need to pass multiple words parameter into a variable. In the below code highlighted areas are the affected ones.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let&amp;nbsp;local_Filename = File1 File2 &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;'File3 File4'n&lt;/STRONG&gt;&lt;/FONT&gt;
%let&amp;nbsp;Excel_table = Sheet1 Sheet2 &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;'Third Sheet'n&lt;/STRONG&gt;&lt;/FONT&gt;
%let SAS_DATASET = Data1 data2 data3

%macro file_process;
%let file_name=%qscan(%bquote(&amp;amp;local_Filename),&amp;amp;i);
%let dataset=%qscan(%bquote(&amp;amp;SAS_DATASET),&amp;amp;i);
%let table=%qscan(%bquote(&amp;amp;Excel_table),&amp;amp;i);
libname xlsFile XLSX "/user/(&lt;FONT color="#FF0000"&gt;&amp;amp;file_name&lt;/FONT&gt; only).xlsm";
PROC SQL;
create table work.&amp;amp;dataset as 
(select * from xlsFile.&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;'&amp;amp;table'n&lt;/STRONG&gt;&lt;/FONT&gt;);
run;
%end;
%mend file_process;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 12:31:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296453#M62124</guid>
      <dc:creator>jayakumarmm</dc:creator>
      <dc:date>2016-09-05T12:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple words parameters into a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296455#M62125</link>
      <description>&lt;P&gt;Highlighting doesn't appear in a code block. You'll need to identify the issues another way.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 05:31:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296455#M62125</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-05T05:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple words parameters into a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296508#M62141</link>
      <description>&lt;P&gt;Gvien below is the code. Multiple words parameter(highlighted) are not getting resolved it is passed differently.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1. Excel_table &lt;/STRONG&gt;parameters reolves lik below which is throwing an error as well.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: &lt;/STRONG&gt;File XLSFILE.'&amp;amp;table'n.DATA does not exist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2. File_name is also resolved incorrectly like this&amp;nbsp;-&amp;nbsp;&lt;/STRONG&gt;/user/2016 July 'File3.xlsm&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CODE:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let local_Filename = File1 File2 &lt;STRONG&gt;'File3 File4'n&lt;/STRONG&gt;&lt;BR /&gt;%let Excel_table = Sheet1 Sheet2 &lt;STRONG&gt;'Third Sheet'n&lt;/STRONG&gt;&lt;BR /&gt;%let SAS_DATASET = Data1 data2 data3&lt;/P&gt;&lt;P&gt;%macro file_process;&lt;BR /&gt;%let file_name=%qscan(%bquote(&amp;amp;local_Filename),&amp;amp;i);&lt;BR /&gt;%let dataset=%qscan(%bquote(&amp;amp;SAS_DATASET),&amp;amp;i);&lt;BR /&gt;%let table=%qscan(%bquote(&amp;amp;Excel_table),&amp;amp;i);&lt;BR /&gt;libname xlsFile XLSX "/user/(&lt;STRONG&gt;&amp;amp;file_name&lt;/STRONG&gt; only).xlsm";&lt;BR /&gt;PROC SQL;&lt;BR /&gt;create table work.&amp;amp;dataset as&lt;BR /&gt;(select * from xlsFile&lt;STRONG&gt;.'&amp;amp;table'n)&lt;/STRONG&gt;;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend file_process;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 12:32:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296508#M62141</guid>
      <dc:creator>jayakumarmm</dc:creator>
      <dc:date>2016-09-05T12:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple words parameters into a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296510#M62143</link>
      <description>&lt;P&gt;Fix one issue at a time. Libname first...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm guessing your third parameter in file list&amp;nbsp;is the issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you actually have () inyour file path? And single quotes with the n?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember macro are a literal text replacement. As mentioned previously, run with debugging options on.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What does that line resolve to with MPRINT and SYMBOLGEN on?&lt;/P&gt;
&lt;P&gt;Please show the log.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 11:49:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296510#M62143</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-05T11:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple words parameters into a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296514#M62147</link>
      <description>&lt;UL&gt;&lt;LI&gt;you need different separators to distinguish different names and specify that separator when calling scan-function&lt;/LI&gt;&lt;LI&gt;macro-variable i is not defined&lt;/LI&gt;&lt;LI&gt;your macro defintion lacks parameters, you are using global variables&lt;/LI&gt;&lt;LI&gt;what is the purpose of the macro?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 11:57:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296514#M62147</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2016-09-05T11:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple words parameters into a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296522#M62150</link>
      <description>&lt;P&gt;I have attached the log. I dont have any single quotes in filename.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let local_Filename = File1 File2 'File3 File4'n;
%let Excel_table = Sheet1 Sheet2 'Third Sheet'n;
%let SAS_DATASET = Data1 data2 data3;
options SYMBOLGEN MPRINT;
%macro file_process;
%let word_cnt = %sysfunc(countW(&amp;amp;local_Filename));
%do  i = 1 %to &amp;amp;word_cnt;
%let file_name=%qscan(%bquote(&amp;amp;local_Filename),&amp;amp;i);
%let dataset=%qscan(%bquote(&amp;amp;SAS_DATASET),&amp;amp;i);
%let table=%qscan(%bquote(&amp;amp;Excel_table),&amp;amp;i);
libname xlsFile XLSX "/user/&amp;amp;file_name only.xlsm";
PROC SQL;
create table work.&amp;amp;dataset as
(select * from xlsFile.'&amp;amp;table'n);
run;
%end;
%mend file_process;
%file_process;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Sep 2016 12:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296522#M62150</guid>
      <dc:creator>jayakumarmm</dc:creator>
      <dc:date>2016-09-05T12:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple words parameters into a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296561#M62161</link>
      <description>&lt;P&gt;Just relating to one error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ERROR: File XLSFILE.'&amp;amp;table'n.DATA does not exist&lt;/PRE&gt;&lt;P&gt;uset double quotes in order to solve the &amp;amp;table macro variable:&lt;/P&gt;&lt;P&gt;that is - change line to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;create table work.data2 as (select * from xlsFile."&amp;amp;table"n);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 15:19:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296561#M62161</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-09-05T15:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple words parameters into a macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296571#M62163</link>
      <description>&lt;P&gt;&amp;nbsp;Is this really your libname? Based on the macro variable it's going to resolve to:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token macroname"&gt;%let&lt;/SPAN&gt; local_Filename &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; File1 File2 &lt;SPAN class="token string"&gt;'File3 File4'&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;n&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i=1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;libname&lt;/SPAN&gt; xlsFile XLSX &lt;SPAN class="token string"&gt;"/user/File1 only.xlsm"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;i=2&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;libname&lt;/SPAN&gt; xlsFile XLSX &lt;SPAN class="token string"&gt;"/user/File2 only.xlsm"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;i=3&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;libname&lt;/SPAN&gt; xlsFile XLSX &lt;SPAN class="token string"&gt;"/user/'File3 only.xlsm"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note the single quote and that since SCAN using space as a delimiter it uses just the File3 part.&lt;/P&gt;
&lt;P&gt;How should this be resolved.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do a similar exercise with your remaining macro variables you'll find your issues. It's tedious but how you debug.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 16:23:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-multiple-words-parameters-into-a-macro-variable/m-p/296571#M62163</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-05T16:23:18Z</dc:date>
    </item>
  </channel>
</rss>

