- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
I am trying to make a macro variable in SAS Studio which saves the "present working directory" as a macro variable.
The SAS-program is run in a "CPF
" process flow file in SAS Studio, and the whole SAS-file and processes are saved and run in a Linux server.
In SAS-Studio, the location of CPF-process flow file seems like in the directory /sasdata/prodpgm/Test..., and when I run a Linux command like
data _null_;
rc = system( 'pwd' );
%put rc;
run;
then I expect that the result will give /sasdata/prodpgm/Test..., but I get another directory instead like /sasinstall/sasconfig/Lev1/SASApp instead, I guess the the process flow file with CPF-suffix is run from this directory.
So the question is how I can find and save the working directory of my cpf
-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.
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.
The software specifications: 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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:
data _null_;
rc=DLGCDIR(“/sasdata/prodpgm/”);
put rc=;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Also, in SAS 9.4 TS1M4 you can use the following code to write the value of the current working directory to the log:
data _null_;
rc=DLGCDIR();
put rc=;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That's right because you are starting the workspace server from the configuration directory.
without referring manually.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Thanks anyway...
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content