<?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: Command for Pulling value from UNIX at runtime in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Command-for-Pulling-value-from-UNIX-at-runtime/m-p/99458#M20936</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow, I did not know about the Filename-Feature for system commands.&lt;/P&gt;&lt;P&gt;Looks great. Thanks for sharing!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Oct 2012 15:22:32 GMT</pubDate>
    <dc:creator>mfab</dc:creator>
    <dc:date>2012-10-18T15:22:32Z</dc:date>
    <item>
      <title>Command for Pulling value from UNIX at runtime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Command-for-Pulling-value-from-UNIX-at-runtime/m-p/99454#M20932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using Base SAS and running codes in UNIX environment.&lt;/P&gt;&lt;P&gt;I am aware of X command, %SYSEXEC by which we can do some unix operations inside SAS.&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;X rm "./test.txt"; (to delete file test.txt)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I need to get in a value from runtime. Is there any command to get Value into SAS.&lt;/P&gt;&lt;P&gt;This will help me a lot as I can get values at run time.&lt;/P&gt;&lt;P&gt;I can write a shell script to get value and pass it to SAS but want to know if I can do it from inside code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 12:22:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Command-for-Pulling-value-from-UNIX-at-runtime/m-p/99454#M20932</guid>
      <dc:creator>KarthikR</dc:creator>
      <dc:date>2012-10-18T12:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Command for Pulling value from UNIX at runtime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Command-for-Pulling-value-from-UNIX-at-runtime/m-p/99455#M20933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to be more specific on how and what kind of values you want to pass to SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since SAS can read almost anything, there are tons of ways to pass/import values into SAS.&lt;/P&gt;&lt;P&gt;One way you might be interested in, is to import OS environment variable values - check out sysget.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 12:45:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Command-for-Pulling-value-from-UNIX-at-runtime/m-p/99455#M20933</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2012-10-18T12:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Command for Pulling value from UNIX at runtime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Command-for-Pulling-value-from-UNIX-at-runtime/m-p/99456#M20934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One - not so elegant - approach would be to write the output of your command into a file and then read this file in a Data-Step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like so:&lt;/P&gt;&lt;P&gt;x df -k | awk '{print $4}' &amp;gt; /somefolder/somefile.txt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA work.data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INFILE '/somefolder/somefile.txt' [...]&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which would create data with all the free space in kbyte (in this example just the free space, not the folders or mount-points for which the free space was analysed. It does not make much sense like this, but then again it is just an example.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 14:32:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Command-for-Pulling-value-from-UNIX-at-runtime/m-p/99456#M20934</guid>
      <dc:creator>mfab</dc:creator>
      <dc:date>2012-10-18T14:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Command for Pulling value from UNIX at runtime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Command-for-Pulling-value-from-UNIX-at-runtime/m-p/99457#M20935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, %SYSGET will retrieve UNIX environment variables, and it may be all you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another feature is the SYSPARM macro variable which is specified when launching SAS from the command line (-sysparm "value", option).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More on this here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000543608.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000543608.htm"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000543608.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If what you need is access to the output of a system command (ls, cat, etc) submited within SAS then take a peak on pipe file commands:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/hostunx/63053/HTML/default/n1ceb0xedanuj3n19l3g73awk1wf.htm" title="http://support.sas.com/documentation/cdl/en/hostunx/63053/HTML/default/n1ceb0xedanuj3n19l3g73awk1wf.htm"&gt;http://support.sas.com/documentation/cdl/en/hostunx/63053/HTML/default/n1ceb0xedanuj3n19l3g73awk1wf.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers from Portugal!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 15:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Command-for-Pulling-value-from-UNIX-at-runtime/m-p/99457#M20935</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2012-10-18T15:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Command for Pulling value from UNIX at runtime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Command-for-Pulling-value-from-UNIX-at-runtime/m-p/99458#M20936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow, I did not know about the Filename-Feature for system commands.&lt;/P&gt;&lt;P&gt;Looks great. Thanks for sharing!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2012 15:22:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Command-for-Pulling-value-from-UNIX-at-runtime/m-p/99458#M20936</guid>
      <dc:creator>mfab</dc:creator>
      <dc:date>2012-10-18T15:22:32Z</dc:date>
    </item>
  </channel>
</rss>

