<?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 unix sas get path of current program in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/unix-sas-get-path-of-current-program/m-p/473865#M121658</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I run sas on unix ,&lt;/P&gt;
&lt;P&gt;I know the code below can get full path plus program name of the current program.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let pathname = %sysfunc(getoption(sysin));

%put pathname;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I only want path without program name. how to program?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jun 2018 18:33:49 GMT</pubDate>
    <dc:creator>GeorgeSAS</dc:creator>
    <dc:date>2018-06-27T18:33:49Z</dc:date>
    <item>
      <title>unix sas get path of current program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unix-sas-get-path-of-current-program/m-p/473865#M121658</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I run sas on unix ,&lt;/P&gt;
&lt;P&gt;I know the code below can get full path plus program name of the current program.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let pathname = %sysfunc(getoption(sysin));

%put pathname;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I only want path without program name. how to program?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 18:33:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unix-sas-get-path-of-current-program/m-p/473865#M121658</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2018-06-27T18:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: unix sas get path of current program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unix-sas-get-path-of-current-program/m-p/473869#M121661</link>
      <description>&lt;P&gt;There may be other ways, but you could certainly get it from &amp;amp;PATHNAME:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let n_remove = %length(%scan(&amp;amp;pathname, -1, /));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let pathname = %substr(&amp;amp;pathname, 1, %length(&amp;amp;pathname) - &amp;amp;n_remove - 1);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The extra -1 at the end removes the final / before the file name.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 18:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unix-sas-get-path-of-current-program/m-p/473869#M121661</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-06-27T18:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: unix sas get path of current program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unix-sas-get-path-of-current-program/m-p/473907#M121670</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path = %sysfunc(getoption(sysin));
%let n_remove3 = %eval(%length(%scan(&amp;amp;path, -1, /)) + %length(%scan(&amp;amp;path, -2, /)) + 1);
%let pathname3 = %substr(%sysfunc(getoption(sysin)), 1, %length(&amp;amp;path) - &amp;amp;n_remove3 - 1);

 %put pathname3 is : |&amp;amp;pathname3.|;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 21:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unix-sas-get-path-of-current-program/m-p/473907#M121670</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2018-06-27T21:01:47Z</dc:date>
    </item>
  </channel>
</rss>

