<?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: Start and override SAS code program/macro variables from command line in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Start-and-override-SAS-code-program-macro-variables-from-command/m-p/356856#M274172</link>
    <description>I've been looking for that. Many Thanks.</description>
    <pubDate>Mon, 08 May 2017 12:51:20 GMT</pubDate>
    <dc:creator>StoneCat</dc:creator>
    <dc:date>2017-05-08T12:51:20Z</dc:date>
    <item>
      <title>Start and override SAS code program/macro variables from command line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Start-and-override-SAS-code-program-macro-variables-from-command/m-p/356845#M274168</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Does the SAS command line command have an option to override a SAS variable?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SAS Code in run_sas_code.sas&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let my_path=/default/path/;
%put &amp;amp;my_path.;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Command line command:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;sas /home/users/me/run_sas_code.sas -log /home/users/me/log.log&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;I want something like that:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;sas /home/users/me/run_sas_code.sas -log /home/users/me/log.log --my_path=/new/path/value/&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 12:16:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Start-and-override-SAS-code-program-macro-variables-from-command/m-p/356845#M274168</guid>
      <dc:creator>StoneCat</dc:creator>
      <dc:date>2017-05-08T12:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Start and override SAS code program/macro variables from command line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Start-and-override-SAS-code-program-macro-variables-from-command/m-p/356846#M274169</link>
      <description>&lt;P&gt;If you want to change the value of a macro variable, you can do so in the AUTOEXEC file, and then it will apply to the entirety of your SAS session; alternatively you could change the value of the macro variable in the first command of your SAS session.&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 12:18:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Start-and-override-SAS-code-program-macro-variables-from-command/m-p/356846#M274169</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-05-08T12:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Start and override SAS code program/macro variables from command line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Start-and-override-SAS-code-program-macro-variables-from-command/m-p/356849#M274170</link>
      <description>Thanks.&lt;BR /&gt;But i want to start sas from an other software via command line. I do not want to modify or customize the SAS files. I guess, however, that I must exchange the .sas file before the run once.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or is there a way to start the SAS file in an existing session?</description>
      <pubDate>Mon, 08 May 2017 12:24:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Start-and-override-SAS-code-program-macro-variables-from-command/m-p/356849#M274170</guid>
      <dc:creator>StoneCat</dc:creator>
      <dc:date>2017-05-08T12:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Start and override SAS code program/macro variables from command line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Start-and-override-SAS-code-program-macro-variables-from-command/m-p/356852#M274171</link>
      <description>&lt;P&gt;When you use -sysparm= on the commandline, the text following the -sysparm= will be available in automatic macro variable &amp;amp;sysparm in the SAS session. Note that you can't change the name of the macro variable.&lt;/P&gt;
&lt;P&gt;A more flexible way for handing parameters to batch programs is the use of operating system environment variables. Consider this shell script:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;export VAR1=xxxxxx
export VAR2=yyyyy
sas program.sas&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and this program:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let var1=%sysget(VAR1);
%let var2=%sysget(VAR2);

data mylib.test;
var1 = "&amp;amp;var1";
var2 = "&amp;amp;var2";
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You will find the contents ("xxxxxx" and "yyyyy") in dataset mylib.test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 12:31:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Start-and-override-SAS-code-program-macro-variables-from-command/m-p/356852#M274171</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-08T12:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Start and override SAS code program/macro variables from command line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Start-and-override-SAS-code-program-macro-variables-from-command/m-p/356856#M274172</link>
      <description>I've been looking for that. Many Thanks.</description>
      <pubDate>Mon, 08 May 2017 12:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Start-and-override-SAS-code-program-macro-variables-from-command/m-p/356856#M274172</guid>
      <dc:creator>StoneCat</dc:creator>
      <dc:date>2017-05-08T12:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Start and override SAS code program/macro variables from command line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Start-and-override-SAS-code-program-macro-variables-from-command/m-p/356967#M274173</link>
      <description>&lt;P&gt;For a discussion and example, see &lt;A href="http://blogs.sas.com/content/iml/2015/03/16/pass-params-sysget.html" target="_self"&gt;"How to pass parameters to a SAS Program."&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 18:29:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Start-and-override-SAS-code-program-macro-variables-from-command/m-p/356967#M274173</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-05-08T18:29:05Z</dc:date>
    </item>
  </channel>
</rss>

