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

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 2 replies
  • 4005 views
  • 3 likes
  • 3 in conversation