Finding and saving present directory of a SAS-Studio-program in a Linux server

622 Views Asked by At

enter image description here

enter image description here

enter image description here

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/model_v1, and when I run a Linux command like X "pwd" then I expect that the result will give /sasdata/model_v1, 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.

If I find the directory, then I guess it should be enough to save them as macro-variable by using %let macrovariable = "/directory"

1

There are 1 best solutions below

1
On BEST ANSWER

I don't think SAS will show you the path of the process file. It doesn't in SAS/Studio 3.5.

It will set the path for a normal program file (as long as you have saved it) in the _SASPROGRAMFILE macro variable.