BookmarkSubscribeRSS Feed
Tater_Salad
Obsidian | Level 7

 Hi We're using SAS EG V 7.13 HF1 (7.100.3.5419) (64-bit).

 

I'm running a script from a local Windows directory. I have a file called sas_pwd.sas I'm referencing in the command:

 

%include 'sas_pwd.sas';

 

However it's not being picked up by my SAS script.

 

I'm getting the following error message.

 

24         %include 'sas_pwd.sas';
WARNING: Physical file does not exist, /sasdata/work/sasuser/rolap/sas_pwd.sas.
ERROR: Cannot open %INCLUDE file sas_pwd.sas.

Which is in my home directory for SAS.

 

So how can I either have the script point to the file on my local machine where it's in the directory say: c:\mydir\me

 

or how can I have the script find the file ion the Linux server where it's in say /home/rolap/?

 

If you can answer to both that'd be a bonus.

5 REPLIES 5
Tater_Salad
Obsidian | Level 7

Hi We're using SAS EG V 7.13 HF1 (7.100.3.5419) (64-bit).

I'm running a script from a local Windows directory. I have a file called sas_pwd.sas I'm referencing in the command:

%include 'sas_pwd.sas';

However it's not being picked up by my SAS script.

I'm getting the following error message.

24         %include 'sas_pwd.sas';
WARNING: Physical file does not exist, /sasdata/work/sasuser/rolap/sas_pwd.sas.
ERROR: Cannot open %INCLUDE file sas_pwd.sas.

Which is in my home directory for SAS.

So how can I either have the script point to the file on my local machine where it's in the directory say: c:\mydir\me

or how can I have the script find the file ion the Linux server where it's in say /home/rolap/?

If you can answer to both that'd be a bonus.

Reeza
Super User
Your EG installation is set up to be a server installation which means you need to work off the server. To see local files, you would need to move the files to a directory the server and your local computer has access to. Then you can move the file to that location and use it. You can upload files or import via the GUI without issue, but scripting is difficult.

If you can run locally, at the top where's the RUN button, you can usually click Run Locally/Server. You cannot switch between the two within a process or program though.


Yes this is a huge pain. Hopefully I'm wrong and someone more versed in EG corrects me 😄
SuryaKiran
Meteorite | Level 14

Is your SAS installed locally (not EG) ? 

Here are the way to check.

- Do you see Local under servers in EG? If yes then locally installed. 

- Run PROC SETINIT; RUN; and see the operating system in log.

 

WARNING: Physical file does not exist, /sasdata/work/sasuser/rolap/sas_pwd.sas.

Looking at your log I can say that your SAS is installed on Unix or Linux server (looking at the path). If you don't give fully qualified physical path then SAS ready from the default (in your case "/sasdata/work/sasuser/rolap/"). 

 

Your EG is connecting to the Server and runs your programs in server not in your local machine. In order to read anything from your local machine to Server or vice versa they need to be connected each other. In most organizations a drive will be mount to server which can be added in local machine as network drive. You may need to contact your admins or colleagues to find that out.

 

You can also transfer files between the server and local machine using open SSH like Putty or WinSCP. Try WinSCP if you have given access to the server.

Thanks,
Suryakiran
Tom
Super User Tom
Super User

If you want your Unix machine to see your local drive then export it and have the system admin mount it somewhere on your Linux machines file system.  Most unix admins will not permit this and you probably don't want to permit it either.

 

Otherwise just access files that are on your linux machine already.  Or upload the files using a file upload task in your Enterprise Guide process flow.

 

If the files are in your home directory you can normally reference that using ~.

 

 %include '~/sas_pwd.sas';

 

SuryaKiran
Meteorite | Level 14

As @Tom mentioned you can use "Copy files" in EG instead of additional WinSCP or some other SSH. Here are the some useful links for Copy file.

 

https://blogs.sas.com/content/sasdummy/2012/12/06/copy-files-in-sas-eg/ 

https://blogs.sas.com/content/sasdummy/2016/11/14/copy-files-task-moved-menus/

 

Thanks,
Suryakiran

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!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 5 replies
  • 1221 views
  • 1 like
  • 4 in conversation