07-06-2017 09:59 AM
Looking for some assistance - I have SAS Enterprise Guide 6.1 M1HF7 (22.214.171.12434) (64-bit). I use citrix reciever and am looking to import all files from a given folder on my local C drive. Below is the code I currently have but for some reason it falls over...
PROC IMPORT DATAFILE='\\Client\C$:\SAS\EME June.CSV' OUT= WORK.NEWDATA DBMS = CSV. REPLACE; GETNAMES=YES;
Please can anyone help?
07-06-2017 10:13 AM
In general, it's likely SAS can't see your local drive and is running on a server somewhere. You may be able to use the GUI version to import your data but that may not work through Citrix either.
Your code has a small error, the period after CSV. And what exactly does 'fall over' mean, that's uninformative. Did you receive an error message?
07-06-2017 10:20 AM
Yeah I get the following error...
NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
ERROR: Physical file does not exist, /opt/sasconfig/grd/Lev1/SASApp/\\Client\C$:\SAS\EME June.csv.
ERROR: Import unsuccessful. See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
07-06-2017 10:54 AM
Your SAS is not running on the Windows server that your Citrix session is running on. It is running on a Unix server. That is why it cannot see the file name you used.
If you are running Enterprise Guide on the Citrix server then you should be able to use the Enterprise Guide menus for importing a CSV file and it will copy the CSV file to the SAS server and then run SAS code to create a SAS dataset from the file it uploaded.
07-06-2017 11:07 AM
07-06-2017 11:10 AM
it depends on your setup but it's unlikely to be solved via SAS alone. Your data will need to be in a location that the server has access to. You can look into the Copy Files EG task but I'm not sure if that can be automated.
Citrix/server security blocks data from leaving a system. It also makes it harder to get data in.
07-06-2017 11:13 AM
The whole Idea is that I want the code to automate the process of importing files into SAS so using the EG menus is a manual process.
Is there any way I can import if my SAS sits on a unix server through method of coding?
Once the files are available on the server where SAS is running it is easy to automate reading all files from a directory (there are dozens of questions on that subject on this forum). So either mount the folder with the files on the Unix server. Or setup an FTP server that can see the files and use FTP to move the files to the Unix server. You can even have SAS ftp the files for you, or read the files via the FTP engine on the FILENAME statement so that you don't need to save copies of the raw files on the SAS server.