Desktop productivity for business analysts and programmers

How do i access a windows folder from EG on Unix machine

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

How do i access a windows folder from EG on Unix machine

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


Accepted Solutions
Solution
‎09-04-2014 06:16 AM
Super User
Posts: 7,380

Re: How do i access a windows folder from EG on Unix machine

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Solution
‎09-04-2014 06:16 AM
Super User
Posts: 7,380

Re: How do i access a windows folder from EG on Unix machine

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Community Manager
Posts: 2,883

Re: How do i access a windows folder from EG on Unix machine

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

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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