DATA Step, Macro, Functions and more

SAS Importing File

Reply
Contributor
Posts: 60

SAS Importing File

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

Super User
Posts: 19,772

Re: SAS Importing File

Posted in reply to CamRutherford

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?

Contributor
Posts: 60

Re: SAS Importing File

Posted in reply to CamRutherford

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.

Super User
Super User
Posts: 7,039

Re: SAS Importing File

Posted in reply to CamRutherford

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.

Contributor
Posts: 60

Re: SAS Importing File

Posted in reply to CamRutherford

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

 

Super User
Posts: 19,772

Re: SAS Importing File

Posted in reply to CamRutherford

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. 

Super User
Super User
Posts: 7,039

Re: SAS Importing File

Posted in reply to CamRutherford

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.

Ask a Question
Discussion stats
  • 6 replies
  • 135 views
  • 0 likes
  • 3 in conversation