<?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: Finding and saving present working directory of a SAS-Studio-program in a Linux server in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393229#M3370</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49880"&gt;@cercig&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are welcome.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Sep 2017 14:18:36 GMT</pubDate>
    <dc:creator>alexal</dc:creator>
    <dc:date>2017-09-05T14:18:36Z</dc:date>
    <item>
      <title>Finding and saving present working directory of a SAS-Studio-program in a Linux server</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393194#M3364</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;IMG src="https://i.stack.imgur.com/akDdK.jpg" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://i.stack.imgur.com/Tpqzy.jpg" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://i.stack.imgur.com/bBJdE.jpg" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I need to manage the historical versions of the model manually, and my plan was creating a copy of the model under another map and SAS would recognize the new map automatically without changing the macro variables.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to make a macro variable in SAS Studio which saves the "present working directory" as a macro variable.&lt;/P&gt;
&lt;P&gt;The SAS-program is run in a "&lt;CODE&gt;CPF&lt;/CODE&gt;" process flow file in SAS Studio, and the whole SAS-file and processes are saved and run in a Linux server.&lt;/P&gt;
&lt;P&gt;In SAS-Studio, the location of CPF-process flow file seems like in the directory&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;/sasdata/prodpgm/Test...&lt;/STRONG&gt;&lt;/SPAN&gt;, and when I run a Linux command like&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data _null_;&lt;BR /&gt; rc = system( 'pwd' );&lt;BR /&gt; %put rc;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;then I expect that the result will give&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;/sasdata/prodpgm/Test...&lt;/STRONG&gt;&lt;/SPAN&gt;, but I get another directory instead like&lt;SPAN&gt;&amp;nbsp;/&lt;STRONG&gt;sasinstall/sasconfig/Lev1/SASApp&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;instead, I guess the the process flow file with&lt;SPAN&gt;&amp;nbsp;&lt;STRONG&gt;CPF&lt;/STRONG&gt;&lt;/SPAN&gt;-suffix is run from this directory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the question is how I can find and save the working directory of my&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;cpf&lt;/CODE&gt;-file and save as a macro-variable, or even maybe for my other sas-files too, I may need the solution for both SAS-files and CPF-files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I asked the same question on another forum, and some said that SAS-Studio can't find your working directory automatically, I need to assign the path myself.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The software specifications:&amp;nbsp;&lt;SPAN&gt;SAS Studio release 3.6 (enterprise edition). SAS release: 9.04.01M4P11092016. SAS platform: Linux LIN X64 3.10.0-514.26.1.el7.x86_64.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2017 12:56:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393194#M3364</guid>
      <dc:creator>cercig</dc:creator>
      <dc:date>2017-09-05T12:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Finding and saving present working directory of a SAS-Studio-program in a Linux server</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393200#M3365</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49880"&gt;@cercig&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Beginning with SAS 9.4 TS1M4, you can change the current working directory via SAS code by using the new DLGCDIR function. Here is an example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  rc=DLGCDIR(“/sasdata/prodpgm/”);
  put rc=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Sep 2017 13:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393200#M3365</guid>
      <dc:creator>alexal</dc:creator>
      <dc:date>2017-09-05T13:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Finding and saving present working directory of a SAS-Studio-program in a Linux server</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393205#M3366</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49880"&gt;@cercig&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, i&lt;SPAN&gt;n SAS 9.4 TS1M4 you can use the following code to write the value of the current working directory to the log:&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;&amp;nbsp;
&amp;nbsp;&amp;nbsp;rc=DLGCDIR();&amp;nbsp;
&amp;nbsp;&amp;nbsp;put rc=;&amp;nbsp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Sep 2017 13:20:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393205#M3366</guid>
      <dc:creator>alexal</dc:creator>
      <dc:date>2017-09-05T13:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Finding and saving present working directory of a SAS-Studio-program in a Linux server</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393219#M3367</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/41748"&gt;@alexal&lt;/a&gt; Thanks. But this data-step with DLGCDIR() gives also the systempath "/sasinstall/sasconfig/..." instead of "/sasdata/prodprgm/..." . I want the SAS-Studio to find the working path "/sasdata/prodpgm/..." automatically without referring manually.</description>
      <pubDate>Tue, 05 Sep 2017 13:58:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393219#M3367</guid>
      <dc:creator>cercig</dc:creator>
      <dc:date>2017-09-05T13:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Finding and saving present working directory of a SAS-Studio-program in a Linux server</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393224#M3368</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49880"&gt;@cercig&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That's right because you are starting the workspace server from the configuration directory.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;without referring manually.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should be able to use these statements with DLGCDIR in an AUTOEXEC file in SAS Studio so that they get submitted to SAS each time you invoke SAS Studio.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2017 14:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393224#M3368</guid>
      <dc:creator>alexal</dc:creator>
      <dc:date>2017-09-05T14:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Finding and saving present working directory of a SAS-Studio-program in a Linux server</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393225#M3369</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/41748"&gt;@alexal&lt;/a&gt;&lt;BR /&gt;I needed automization because I need to handle the model versions manually right now. So if I need to define the working path manually with each version of the model (each version will be under its own map), then there is no difference between using DLGCDIR() or typing the path manually in each time.&lt;BR /&gt;Thanks anyway...</description>
      <pubDate>Tue, 05 Sep 2017 14:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393225#M3369</guid>
      <dc:creator>cercig</dc:creator>
      <dc:date>2017-09-05T14:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Finding and saving present working directory of a SAS-Studio-program in a Linux server</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393229#M3370</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49880"&gt;@cercig&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are welcome.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2017 14:18:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Finding-and-saving-present-working-directory-of-a-SAS-Studio/m-p/393229#M3370</guid>
      <dc:creator>alexal</dc:creator>
      <dc:date>2017-09-05T14:18:36Z</dc:date>
    </item>
  </channel>
</rss>

