BookmarkSubscribeRSS Feed
CamRutherford
Fluorite | Level 6

Hello,

 

Looking for some assistance - I have SAS Enterprise Guide 6.1 M1HF7 (6.100.0.4234) (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?

 

Thanks,

Cam

6 REPLIES 6
Reeza
Super User

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?

CamRutherford
Fluorite | Level 6

Hi,

 

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
WORK.PARMS.PARMS.SLIST.
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.

Tom
Super User Tom
Super User

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.

CamRutherford
Fluorite | Level 6

Hi @Tom@Reeza

 

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?

 

Thanks,

Cam

 

Reeza
Super User

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. 

Tom
Super User Tom
Super User

@CamRutherford wrote:

Hi @Tom@Reeza

 

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?

 

Thanks,

Cam

 


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.

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!

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
  • 6 replies
  • 1434 views
  • 0 likes
  • 3 in conversation