How do you change the current folder? The default appears to be fixed as the Workspace folder

Philip Holland
Philip Holland Altair Community Member
edited December 2023 in Community Q&A

WPS Analytics Workbench: 4.4.6.0.5780-GA-release

Licence: Community Edition

Platform: Windows 11 Professional

In SAS any of these program statements can be used to change the current folder: X, SYSTASK, %SYSEXEC. None of these appear to have any effect in the WPS Workbench, and the default directory is set as the open Workspace folder.

Is there a way to update the current folder with a SAS program statement or WPS configuration setting?

..............Phil

Answers

  • Nico Chart_21517
    Nico Chart_21517
    Altair Employee
    edited March 2023

    Hi Phil,

    If you use MouseButton3 context menu on "Local Server" (in the server explorer subwindow), where in the Properties you can find the "Initial current directory" setting. That might be what you want?

    Best Regards,
    Nico

     

  • Philip Holland
    Philip Holland Altair Community Member
    edited March 2023

    I have found the Properties and the "Initial current directory" setting, which is read-only on the Environment tab, but could be set to "${workspace_loc}" or "${project_loc}" in the Startup tab. However, neither controls the working directory in the current session. It may be easier to set the -SASINITIALFOLDER parameter in wps.cfg, except that can only be put into a Workspace folder, so it can never be updated to point to the current Project in a session.

    What I'm looking for is an easy Workbench setup equivalent to running the CLI "wps" command in an arbitrary folder, in the same way that X, SYSTASK and %SYSEXEC can change the current folder in SAS. I wrote a conference paper many years ago called "Running Clinical Trials Programs with Enterprise Guide", which uses these statements to setup starting folders for program flows.

  • Nico Chart_21517
    Nico Chart_21517
    Altair Employee
    edited December 2023

    Hi Phil,

    Just rediscovered this request. Did you get anywhere with this or shall I create a support ticket in your name to follow up on it?

    Nico

  • Philip Holland
    Philip Holland Altair Community Member
    edited December 2023

    Hi Nico,

    The current folder is still fixed in 5.24, and I now believe that this is caused by the functionality in Eclipse, which uses the Workspace folder for its own reasons.

    While I do have access to "wps" command line interface, I would rather have a little more flexibility in Altair Analytics Workbench, and I suspect there are more AAW users who would welcome it too for more compatibility with interactive SAS, SAS Studio and Enterprise Guide.

    A support ticket in my name will, at least, guarantee that the developers are aware of the need.

    Thanks...........Phil

  • Geoff Mole
    Geoff Mole
    Altair Employee
    edited December 2023

    Hi Phil,

    You are right that the current working directory from the workbench is the workspace root and the current working directory for the wps CLI is the folder where you run the program, typically that contains .sas files. Some customers wished to have the choice of setting the current working directory in the workbench to that of the source file location wherever that is. 

    If this would be useful to you then you can select the 'Properties' of the 'Local Server' or 'Remote Server' and there should be a menu item on the LHS called 'Code Submission'. If you tick the box that says 'Set working directory to program directory on code submission' it would be as if you had cd'd to that folder and then ran the compiler. I appreciaite this it not 'total' control over the current working directory but it is a current user choice.

    Regards,

    Geoff

  • Philip Holland
    Philip Holland Altair Community Member
    edited December 2023

    Hi Phil,

    You are right that the current working directory from the workbench is the workspace root and the current working directory for the wps CLI is the folder where you run the program, typically that contains .sas files. Some customers wished to have the choice of setting the current working directory in the workbench to that of the source file location wherever that is. 

    If this would be useful to you then you can select the 'Properties' of the 'Local Server' or 'Remote Server' and there should be a menu item on the LHS called 'Code Submission'. If you tick the box that says 'Set working directory to program directory on code submission' it would be as if you had cd'd to that folder and then ran the compiler. I appreciaite this it not 'total' control over the current working directory but it is a current user choice.

    Regards,

    Geoff

    Hi Geoff,

    Always interested in finding alternatives, so I will investigate your suggestion and report back.

    Many thanks..............Phil

  • Philip Holland
    Philip Holland Altair Community Member
    edited December 2023

    Hi Phil,

    You are right that the current working directory from the workbench is the workspace root and the current working directory for the wps CLI is the folder where you run the program, typically that contains .sas files. Some customers wished to have the choice of setting the current working directory in the workbench to that of the source file location wherever that is. 

    If this would be useful to you then you can select the 'Properties' of the 'Local Server' or 'Remote Server' and there should be a menu item on the LHS called 'Code Submission'. If you tick the box that says 'Set working directory to program directory on code submission' it would be as if you had cd'd to that folder and then ran the compiler. I appreciaite this it not 'total' control over the current working directory but it is a current user choice.

    Regards,

    Geoff

    Hi Geoff,

    While it is not, as you say, a 'total' solution, it does allow me to save and run my SAS programs where I would like them to be. This is a good, but still incomplete, workaround.

    Ideally I would still like Altair SLC to replicate the SAS program statements used to change the current folder: X, SYSTASK, %SYSEXEC. This will permit more existing SAS programs to be run in Altair SLC without radical re-writing.

    Thanks............Phil

    PS. The feature you detailed will, however, be explained in one of the Altair-related chapters in my next book: "Memoirs of a Power SAS User". Thank you.