<?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: launch batch with multiple parameter retrieve scan in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377375#M90604</link>
    <description>&lt;P&gt;I found the solution ! I have to use %QSCAN instead of %SCAN !&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;thanks for your help !!!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jul 2017 15:05:27 GMT</pubDate>
    <dc:creator>Nasser_DRMCP</dc:creator>
    <dc:date>2017-07-19T15:05:27Z</dc:date>
    <item>
      <title>launch batch with multiple parameter retrieve scan</title>
      <link>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377231#M90564</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to lauch a sas prgm in batch with multiple parameters by using sysparm.&lt;/P&gt;&lt;P&gt;this code below works well in sas guide&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; SYSPARM = 2015 2017 ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; p_GENERATION_START = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%scan&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;sysparm,1) ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; p_GENERATION_END = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%scan&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;sysparm,2) ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&amp;nbsp; &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;amp;p_GENERATION_START &amp;amp;p_GENERATION_END ; this line returns 2015 2017 as intended.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;But whenever I launch the prgm in batch by fill in 2015 2017, I notice that only the first parameter (2015) is put within the log file.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;Many thanks in advance for your help.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Nasser&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 10:44:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377231#M90564</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2017-07-19T10:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: launch batch with multiple parameter retrieve scan</title>
      <link>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377242#M90567</link>
      <description>&lt;P&gt;Try passing the parameter enclosed in quotes. Removing the quotes in the program may be necessary.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 10:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377242#M90567</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2017-07-19T10:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: launch batch with multiple parameter retrieve scan</title>
      <link>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377246#M90568</link>
      <description>&lt;P&gt;Just tested &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt; suggestion on AIX with SAS 9.4.&lt;/P&gt;
&lt;PRE&gt;sas test.sas -sysparm "2015 2017"&lt;/PRE&gt;
&lt;P&gt;resulted in this log:&lt;/P&gt;
&lt;PRE&gt;1          data _null_;
2          do i = 1 to countw("&amp;amp;sysparm");
3            x1 = scan("&amp;amp;sysparm",i);
4            put x1=;
5          end;
6          run;

x1=2015
x1=2017
&lt;/PRE&gt;
&lt;P&gt;At least on a UNIX, the commandline parser removes the quotes when dissecting the whole commandline.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 11:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377246#M90568</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-19T11:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: launch batch with multiple parameter retrieve scan</title>
      <link>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377263#M90570</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;thanks for your response but It does not work.&amp;nbsp;my prgm&amp;nbsp;bellow :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; =========&amp;gt; &amp;amp;SYSPARM ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;p_GENERATION_START = scan(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;sysparm"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;p_GENERATION_END = scan(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;sysparm"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;===============&amp;gt; p_GENERATION_START p_GENERATION_END ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then I launch it with the param 2017 2015 (so without quotes) but put returns nothing !&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 11:56:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377263#M90570</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2017-07-19T11:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: launch batch with multiple parameter retrieve scan</title>
      <link>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377265#M90572</link>
      <description>&lt;P&gt;Your data step variables are gone as soon as the data _null_ finishes, so the log of your program (saved as test.sas in my environment and called with the commandline as stated in my previous post) looks like this:&lt;/P&gt;
&lt;PRE&gt;1          %put =========&amp;gt; &amp;amp;SYSPARM ;
=========&amp;gt; 2015 2017
2
3          data _null_ ;
4          p_GENERATION_START = scan("&amp;amp;sysparm",1) ;
5          p_GENERATION_END = scan("&amp;amp;sysparm",2) ;
6          run ;

NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


7
8          %put===============&amp;gt; p_GENERATION_START p_GENERATION_END ;
===============&amp;gt; p_GENERATION_START p_GENERATION_END
&lt;/PRE&gt;
&lt;P&gt;You can see that sysparm contains the whole "2015 2017" string without the quotes, but the %put fails. Adapt your code like this to get macro variables:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put =========&amp;gt; &amp;amp;SYSPARM;

%let p_GENERATION_START = %scan(&amp;amp;sysparm,1);
%let p_GENERATION_END = %scan(&amp;amp;sysparm,2);

%put===============&amp;gt; &amp;amp;p_GENERATION_START &amp;amp;p_GENERATION_END;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;after running&lt;/P&gt;
&lt;PRE&gt;sas test.sas -sysparm "2015 2017"&lt;/PRE&gt;
&lt;P&gt;you'll get&lt;/P&gt;
&lt;PRE&gt;1          %put =========&amp;gt; &amp;amp;SYSPARM;
=========&amp;gt; 2015 2017
2
3          %let p_GENERATION_START = %scan(&amp;amp;sysparm,1);
4          %let p_GENERATION_END = %scan(&amp;amp;sysparm,2);
5
6          %put===============&amp;gt; &amp;amp;p_GENERATION_START &amp;amp;p_GENERATION_END;
===============&amp;gt; 2015 2017
&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jul 2017 12:06:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377265#M90572</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-19T12:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: launch batch with multiple parameter retrieve scan</title>
      <link>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377298#M90583</link>
      <description>&lt;P&gt;thanks Kurt but I do not manage.&amp;nbsp;I copy/past what you suggests&amp;nbsp;then my only code is...&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; =========&amp;gt; &amp;amp;SYSPARM;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; p_GENERATION_START = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%scan&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;sysparm,1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; p_GENERATION_END = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%scan&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&amp;amp;sysparm,2);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;===============&amp;gt; &amp;amp;p_GENERATION_START &amp;amp;p_GENERATION_END;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;and I launch with "2015 2017"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;But the log is named 2017 (why not my progm name ???) and the log is empty &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 12:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377298#M90583</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2017-07-19T12:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: launch batch with multiple parameter retrieve scan</title>
      <link>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377305#M90586</link>
      <description>&lt;P&gt;- on which operating system are you doing this?&lt;/P&gt;
&lt;P&gt;- please copy the commandline &lt;U&gt;exactly as you entered it&lt;/U&gt; into a {i} window here.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 13:13:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377305#M90586</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-19T13:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: launch batch with multiple parameter retrieve scan</title>
      <link>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377306#M90587</link>
      <description>&lt;P&gt;If the code is only&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; =========&amp;gt; &amp;amp;SYSPARM ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;and the prgm launched with 2015, so then&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;the result is correct &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put =========&amp;gt; &amp;amp;SYSPARM ;&lt;BR /&gt;=========&amp;gt; 2015&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 13:14:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377306#M90587</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2017-07-19T13:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: launch batch with multiple parameter retrieve scan</title>
      <link>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377345#M90595</link>
      <description>&lt;P&gt;I lauch the program via within unix system (Putt). I don't know exactly the command because a menu has been created. I use the menu. I just have to specify the prgm name and the step after the prompt is "SYSPARM ?"&amp;nbsp;&amp;nbsp;I have to specify 2015 2016&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 14:18:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377345#M90595</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2017-07-19T14:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: launch batch with multiple parameter retrieve scan</title>
      <link>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377375#M90604</link>
      <description>&lt;P&gt;I found the solution ! I have to use %QSCAN instead of %SCAN !&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;thanks for your help !!!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 15:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/launch-batch-with-multiple-parameter-retrieve-scan/m-p/377375#M90604</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2017-07-19T15:05:27Z</dc:date>
    </item>
  </channel>
</rss>

