<?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 list of parameters to variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296447#M62119</link>
    <description>&lt;P&gt;I'm not familiar with that option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you should do is make sure you have working code and then switch it over to a macro version.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Sep 2016 04:43:10 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-09-05T04:43:10Z</dc:date>
    <item>
      <title>How to pass list of parameters to variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296415#M62099</link>
      <description>&lt;P&gt;I need to pass a list of paramters as variable in SAS program. Given below is the logic&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Filename = ('File1','File2',file3');&lt;/P&gt;&lt;P&gt;sas_dataset = ('data1','data2','data3');&lt;/P&gt;&lt;P&gt;Excel_table = ('table1','table2',table3');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;libname xlsFile XLSX "/user/&amp;amp;Filename.";


options validvarname=v7;
PROC SQL;
    create table work.&amp;amp;SAS_dataset. as 
	(select * from xlsFile.&amp;amp;Excel_table.);
 quit;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Sep 2016 21:44:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296415#M62099</guid>
      <dc:creator>jayakumarmm</dc:creator>
      <dc:date>2016-09-04T21:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass list of parameters to variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296417#M62100</link>
      <description>&lt;P&gt;You need a macro loop and you need to retrieve each value from the list iteratively.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This example explains how to loop through a list. You can place your code within the macro block.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/mcrolref/67912/HTML/default/viewer.htm#p1n2i0ewaj1zian1ria5579z1zjh.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/mcrolref/67912/HTML/default/viewer.htm#p1n2i0ewaj1zian1ria5579z1zjh.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Give it a shot and if you have issues post the code you've tried and we can help with any debugging.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Sep 2016 21:56:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296417#M62100</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-04T21:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass list of parameters to variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296435#M62109</link>
      <description>&lt;P&gt;Thank you for sharing the link. I am able proceed now expect the below logic. Variables are not getting replaced with respective values.i.e. &amp;amp;dataset and &amp;amp;dataset_tera while creating teradata table with SAS dataset&lt;/P&gt;&lt;P&gt;Error message: data schema.Table1_&amp;amp;dataset ( dbcreate_table_opts='primary index(col1,col2)'&lt;BR /&gt;___________________&lt;BR /&gt;22&lt;BR /&gt;! fastload=yes sleep=1 tenacity=2 sessions=10 ); set WORK.&amp;amp;dataset_tera; run;&lt;BR /&gt;ERROR 22-7: Invalid option name DBCREATE_TABLE_OPTS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Filename1 = FILE1 FILE2;
%let SAS_DATASET = DATA1 DATA2;
%let Excel_table = TABLE1 TABLE2;
%let SAS_DATASET_TERA = TERA1 TERA1;

options validvarname=v7;

%macro file_process_tera;
%let word_cnt = %sysfunc(countW(&amp;amp;Filename1));
%do  i = 1 %to &amp;amp;word_cnt;
%let file_name=%qscan(%bquote(&amp;amp;Filename1),&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);
%let dataset_tera=%qscan(%bquote(&amp;amp;SAS_DATASET_TERA),&amp;amp;i);&lt;BR /&gt;
data Schema.TABLE1_&amp;amp;dataset
   (  
    dbcreate_table_opts='primary index(col1,col2)' 
      fastload=yes sleep=1 tenacity=2 sessions=10 
      );
    set WORK.&amp;amp;dataset_tera;
run;
%end;
%mend file_process_tera;
%file_process_tera;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 02:58:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296435#M62109</guid>
      <dc:creator>jayakumarmm</dc:creator>
      <dc:date>2016-09-05T02:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass list of parameters to variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296436#M62110</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure to run with debugging options on:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Options SYMBOLGEN MPRINT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm fairly certain your libname is the issue. You need two periods after the macro variable. One to denote the end of the macro variable and one for the XLSM extension. But that also doesn't make sense because the macro variable has two values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Though you dont appear to use the libname so I'm not sure what's going on or why the code is there.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run the code with the options to see the generated code. It needs to be valid SAS code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 03:01:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296436#M62110</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-05T03:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass list of parameters to variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296438#M62112</link>
      <description>&lt;P&gt;Thank you for your repsonse. I have libname but I missed it while sharing. Error is thrown in this line&lt;/P&gt;&lt;P&gt;(dbcreate_table_opts='primary index(col1,col2)' fastload=yes sleep=1 tenacity=2 sessions=10);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-7: Invalid option name DBCREATE_TABLE_OPTS.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-7: Invalid option name FASTLOAD.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-7: Invalid option name SLEEP.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-7: Invalid option name TENACITY.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.
ERROR 22-7: Invalid option name SESSIONS.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 03:39:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296438#M62112</guid>
      <dc:creator>jayakumarmm</dc:creator>
      <dc:date>2016-09-05T03:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass list of parameters to variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296446#M62118</link>
      <description>&lt;P&gt;Issue is fixed now after concatenating the teradata table separately in a variable.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 04:42:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296446#M62118</guid>
      <dc:creator>jayakumarmm</dc:creator>
      <dc:date>2016-09-05T04:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass list of parameters to variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296447#M62119</link>
      <description>&lt;P&gt;I'm not familiar with that option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you should do is make sure you have working code and then switch it over to a macro version.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 04:43:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-list-of-parameters-to-variables/m-p/296447#M62119</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-05T04:43:10Z</dc:date>
    </item>
  </channel>
</rss>

