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
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.
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.
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
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.