<?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: Program path in unix in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Program-path-in-unix/m-p/281520#M57108</link>
    <description>&lt;P&gt;What program? &amp;nbsp;The program that is currently runnin? How did you submit the program to run? &amp;nbsp;If you submitted it from the command line then use the value of the SYSIN option.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path = %sysfunc(getoption(sysin));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the file doesn't exist then you might try adding .sas to the end of the value to see if it does.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if ^%sysfunc(fileexist(&amp;amp;path)) %then %let path = &amp;amp;path..sas;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want the FULL path then make a filename and using the PATHNAME() function to get the real filename.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  %let rc = %sysfunc(filename(fileref,&amp;amp;path));
  %let path = %sysfunc(pathname(&amp;amp;fileref));
  %let rc = %sysfunc(filename(fileref));&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 30 Jun 2016 17:16:10 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2016-06-30T17:16:10Z</dc:date>
    <item>
      <title>Program path in unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-path-in-unix/m-p/281500#M57105</link>
      <description>&lt;P&gt;How do I obtain the full path of a SAS program on a Unix-based system (SAS 9.4 TM1S1) automatically?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 16:52:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-path-in-unix/m-p/281500#M57105</guid>
      <dc:creator>Doug____</dc:creator>
      <dc:date>2016-06-30T16:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Program path in unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-path-in-unix/m-p/281502#M57107</link>
      <description>&lt;P&gt;As long as you're talking about a batch job, it's straightforward to capture the name as a macro variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let path = %sysfunc(getoption(sysin));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you get into interactive use, you have to consider what you're asking for ... last program brought into the current Program Editor window?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 17:06:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-path-in-unix/m-p/281502#M57107</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-30T17:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Program path in unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-path-in-unix/m-p/281520#M57108</link>
      <description>&lt;P&gt;What program? &amp;nbsp;The program that is currently runnin? How did you submit the program to run? &amp;nbsp;If you submitted it from the command line then use the value of the SYSIN option.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path = %sysfunc(getoption(sysin));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the file doesn't exist then you might try adding .sas to the end of the value to see if it does.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if ^%sysfunc(fileexist(&amp;amp;path)) %then %let path = &amp;amp;path..sas;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want the FULL path then make a filename and using the PATHNAME() function to get the real filename.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  %let rc = %sysfunc(filename(fileref,&amp;amp;path));
  %let path = %sysfunc(pathname(&amp;amp;fileref));
  %let rc = %sysfunc(filename(fileref));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jun 2016 17:16:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-path-in-unix/m-p/281520#M57108</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-06-30T17:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Program path in unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-path-in-unix/m-p/283030#M57610</link>
      <description>&lt;P&gt;The option suggested only renders the word "path" on a remote sumission. Are there other options?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 19:23:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-path-in-unix/m-p/283030#M57610</guid>
      <dc:creator>Doug____</dc:creator>
      <dc:date>2016-07-08T19:23:21Z</dc:date>
    </item>
  </channel>
</rss>

