<?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: SYSPARM calling shell script variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216111#M307640</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use double quotes instead of single quotes in your command line.&amp;nbsp; The unix shell is not expanding the variable reference and so the literal text '$CSV' will be passed to SAS as the value of SYSPARM macro variable.&amp;nbsp; To test it just use ECHO command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Compare:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;echo &lt;SPAN style="background-color: #ffffff;"&gt;-sysparm '$CSV $upd_date' &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;to&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;echo &lt;SPAN style="background-color: #ffffff;"&gt;-sysparm "$CSV $upd_date"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Aug 2015 15:33:24 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-08-04T15:33:24Z</dc:date>
    <item>
      <title>SYSPARM calling shell script variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216103#M307632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have wrote a sas program that takes in two sysparms upd_date and CSV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am automating these into autosys and running a shell script to execute my program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nohup sas program.sas -sysparm '$CSV $upd_date' -noterminal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering if there's anyway that you can read in a shell script defined variable into a sysparm call. Right now I read in my sysparms like so: %LET CSV = %SYSFUNC(TRIM(%QSCAN(&amp;amp;SYSPARM,1,%NRSTR(' '))));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it is reading them in as a character $CSV and not TRANSACTION (which is what CSV is set to in shell script)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any tips or solutions to this, will this work or should I try a different route.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2015 20:00:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216103#M307632</guid>
      <dc:creator>Bensansing</dc:creator>
      <dc:date>2015-08-03T20:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: SYSPARM calling shell script variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216104#M307633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%LET CSV = %SYSFUNC(TRIM(%QSCAN(&amp;amp;SYSPARM,1,&lt;STRONG&gt;%STR( )&lt;/STRONG&gt;)));&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 13:53:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216104#M307633</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-08-04T13:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: SYSPARM calling shell script variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216105#M307634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply, this way is still reading in the macro variables as $CSV in my sas code and not what was defined in the shell script.&lt;/P&gt;&lt;P&gt;CSV=TRANSACTION in shell script. Not sure if it's possible to bring in shell script defined variables into a sysparm command.&lt;/P&gt;&lt;P&gt;Thanks for the input though&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 14:32:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216105#M307634</guid>
      <dc:creator>Bensansing</dc:creator>
      <dc:date>2015-08-04T14:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: SYSPARM calling shell script variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216106#M307635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Am not too familiar with your OS syntax, however if the variable needs to be de-referenced then it can't go in quotes as far as I know.&amp;nbsp; Have you tried:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;nohup sas program.sas -sysparm $CSV $upd_date -noterminal&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;If that doesn't work you may need to wrap in a batch file to echo out the full string.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 14:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216106#M307635</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-08-04T14:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: SYSPARM calling shell script variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216107#M307636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah that doesn't work either, I also tried concatenating full string to run into one variable which didn't work. I think I will take an approach to wrap in a batch file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 14:58:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216107#M307636</guid>
      <dc:creator>Bensansing</dc:creator>
      <dc:date>2015-08-04T14:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: SYSPARM calling shell script variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216108#M307637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What happens if you use SYSGET on the values scanned from SYSPARM?&amp;nbsp; You may also be able to skip this SYSPARM and just use SYSGET in your code.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 15:22:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216108#M307637</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-08-04T15:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: SYSPARM calling shell script variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216109#M307638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I also tried using SYSGET yesterday and wasn't working.. was still showing up as $CSV unfortunately&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 15:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216109#M307638</guid>
      <dc:creator>Bensansing</dc:creator>
      <dc:date>2015-08-04T15:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: SYSPARM calling shell script variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216110#M307639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;shell command EVAL might fix it &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eval "&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;nohup sas program.sas -sysparm '$CSV $upd_date' -noterminal"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 15:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216110#M307639</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-08-04T15:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: SYSPARM calling shell script variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216111#M307640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use double quotes instead of single quotes in your command line.&amp;nbsp; The unix shell is not expanding the variable reference and so the literal text '$CSV' will be passed to SAS as the value of SYSPARM macro variable.&amp;nbsp; To test it just use ECHO command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Compare:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;echo &lt;SPAN style="background-color: #ffffff;"&gt;-sysparm '$CSV $upd_date' &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;to&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 14pt;"&gt;echo &lt;SPAN style="background-color: #ffffff;"&gt;-sysparm "$CSV $upd_date"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 15:33:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216111#M307640</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-08-04T15:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: SYSPARM calling shell script variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216112#M307641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can't believe I didnt think of that to try, thanks for everyone's input and help! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 15:40:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216112#M307641</guid>
      <dc:creator>Bensansing</dc:creator>
      <dc:date>2015-08-04T15:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: SYSPARM calling shell script variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216113#M307642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you remove the $sign?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 16:15:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216113#M307642</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-08-04T16:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: SYSPARM calling shell script variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216114#M307643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Keep it as: nohup sas program.sas -sysparm "$CSV $upd_date" -noterminal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The change to double quotes makes it work.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN lang="EN"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;"Macro variable CSV resolves to TRANSACTION"&lt;/P&gt;&lt;P&gt;"Macro variable upd_date resolves to 4"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 16:55:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216114#M307643</guid>
      <dc:creator>Bensansing</dc:creator>
      <dc:date>2015-08-04T16:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: SYSPARM calling shell script variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216115#M307644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was referring to SYSGET&amp;nbsp; i.e. sysget('$CSV') vs sysget('CSV');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2015 18:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSPARM-calling-shell-script-variable/m-p/216115#M307644</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-08-04T18:09:30Z</dc:date>
    </item>
  </channel>
</rss>

