BookmarkSubscribeRSS Feed
DDutton
Fluorite | Level 6

I have discovered a limitation  in Enterprise Guide 7.12 which I can't find in the documentation. 

 

If I open a program in EG in a way that uses UNC notation, even though the program is on the same physical server as the SASApp server, the variable &_sasprogramfile has a null value. 

 

For example, if I have server PRDSRV which is the server on which my program is stored, and is also the server running the SASApp server, and I open the program like this:

Menu bar Program-> Open Program-> Desktop->File Explorer Shortcut to \\PRDSRV\path-to-program, select testprog.sas, click Open.

The testprog.sas program is added to my project with a File Path (in Properties) of:\\PRDSRV\path-to-program\testprog.sas

When I run this program and in it do a %put &_sasprogramfile; the value of this macro variable is null.

 

On the other hand, if I open the program by one of these two ways, the File Path property and the macro variable are populated differently:

1) in the Servers pane (lower left) select SASApp-> Files-> Shares and traverse the path to the same program, right click and select Open  or,

2) Menu bar Program-> Open Program-> Servers->SASApp> Files-> Shares and traverse the path to the same program, right click and select Open.

The testprog.sas program is added to my project with a File Path (in Properties) of: Shares\path-to-program\testprog.sas

When I run this program and in it do a %put &_sasprogramfile; the value of this macro variable is G:\.Shares\path-to-program\testprog.sas

 

Clearly, the SAS Admins have mapped a G:\ drive on the server running the SASApp server.  (There is no G:\drive mapped on the server where I am running the EG client.).  And it appears that when UNC notation is used, SAS doesn't realize that this path is on the same server as the one running the SASApp server.  But I can't find that documented anywhere.  

 

The EG Doc does say this:

_SASPROGRAMFILE    The full path and filename of the SAS program that is currently being run. This macro variable is available only for SAS program files that are saved on the same server on which your SAS Enterprise Guide code is being run.

 

There is no mention of not supporting UNC notation.  Has anyone else run in to this?  We have programs that expect &_sasprogramfile to be populated, and this causes a problem if users do not open the program in the "correct" way.

1 REPLY 1
CaseySmith
SAS Employee

Hi @DDutton,

 

This is how the _sasprogramfile macro was previously designed to work.  The _sasprogramfile would only be set when the program was opened via the server (it would not be set when the program was opened through the context of the local file system).  This guaranteed that the path in the _sasprogramfile macro (when set) would always be in the context of the executing server (accessible from the server machine).  In other words, if you used the _sasprogramfile macro in SAS code on that server, the server would be able to reach the file path.  The same cannot be said for programs opened through the context of the local file system.  The server would only be able to access if a UNC path AND if the server had similar network access to the file as through the local file system.

 

As a result of user feedback, we changed how this works (starting in EG 7.15 and hotfixed in EG 7.13 HF2).  We are now always setting _SASPROGRAMFILE to the path of the program file, regardless of whether the program file is on the same server as the executing server, a different server than the executing server, or the local client file system. However, since this means there would no longer be guaranteed context for the file path, we also added a _SASPROGRAMFILEHOST macro (and _CLIENTPROJECTPATHHOST for _CLIENTPROJECTPATH) to provide context for the paths in the corresponding macro variables.

 

All this to say, if you upgrade to EG 7.13 HF2 or later (7.15 is current latest), it will work the way you probably expect.

 

Casey


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1577 views
  • 0 likes
  • 2 in conversation