BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
asdf_sas
Calcite | Level 5

Hi all,

Im using the EG over a Citrix Client from my windows pc.

I would like to open a folder located on windows within the EG. (I would like to open this folder and read all items (csv-files) in it for further processings)

Am I unable to access the windows folder from two different environments?

Here are essential lines of code:

%macro read_directory();

%let path = I:\xxx\xxx\xxx\xxx\xxxxx;

%global lstname;

%let member = 1;

filename dir "&path\*";

%let filrf = mydir;

%let rc=%sysfunc(filename(filrf,&path));

%let did=%sysfunc(dopen(&filrf));

%let memcount=%sysfunc(dnum(&did));

%if &memcount > 0 %then %do;

    %do %while(&member le &memcount);

         %let lstname=%sysfunc(dread(&did, &member));

    %end;

%end;

%let rc=%sysfunc(dclose(&did));

%mend;

%read_directory;

But the path resolves to:

ERROR: Physical file does not exist, /opt/sas/config/Lev1/SASApp/I:\xxx\xxx\xxx\xxx\xxxxx;

Im pretty new in accessing data from different machines- i hope some of you can help me how to tell the EG that its has to refer to windows only

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

The Workspace Server that actually runs the SAS code generated by the Enterprise Guide resides on a UNIX server.

In order to access files on your local computer, you need to have at least a part of your filesystem accessible (mounted) on the UNIX server and must use the correct syntax as shown in the first part (/opt/sas/config/Lev1/SASApp) of the offending file path.

This directory is actually the one from which the Workspace Server process is started; since a Windows file name does not meet the requirements of a fully qualified UNIX file name (ie starts with a forward slash), your given file path was simply appended to the current working directory.

You may have a network path on a network file server that is both visible from your desktop and the UNIX server, so you could place your files there.

Still another method would be to use a tool like WinSCP to copy the file(s) to your home directory on the UNIX server and then use $HOME/filename in the macro variable path.

View solution in original post

2 REPLIES 2
Kurt_Bremser
Super User

The Workspace Server that actually runs the SAS code generated by the Enterprise Guide resides on a UNIX server.

In order to access files on your local computer, you need to have at least a part of your filesystem accessible (mounted) on the UNIX server and must use the correct syntax as shown in the first part (/opt/sas/config/Lev1/SASApp) of the offending file path.

This directory is actually the one from which the Workspace Server process is started; since a Windows file name does not meet the requirements of a fully qualified UNIX file name (ie starts with a forward slash), your given file path was simply appended to the current working directory.

You may have a network path on a network file server that is both visible from your desktop and the UNIX server, so you could place your files there.

Still another method would be to use a tool like WinSCP to copy the file(s) to your home directory on the UNIX server and then use $HOME/filename in the macro variable path.

ChrisHemedinger
Community Manager

Being on Citrix, you might have limited ability to add a custom task to your EG environment.  However, there is a useful "Copy Files" task that can help you to move files between your SAS session on UNIX and your EG Windows environment:

There and back again: copying files in SAS Enterprise Guide - The SAS Dummy

Chris

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 4429 views
  • 3 likes
  • 3 in conversation