Desktop productivity for business analysts and programmers

Bulk uploading csv files from Windows to SAS Server

Reply
New Contributor
Posts: 4

Bulk uploading csv files from Windows to SAS Server

[ Edited ]

Hi All,

 

I'm trying to upload around 600 csv files, with differing content, from Windows to a SAS Server to use in DI. Can't import via DI as the facility is switched off due to security limitations. I've come up with a workaround which is using EGs Import Data task but I don't fancy setting a task up for 600 tables as I'd rapidly lose the will to live....

 

This is in the code for the import task...

 

Note: In preparation for running the following code, the Import
Data wizard has used internal routines to transfer the source data
file from the local file system to SASApp-CPB. There is no SAS code
available to represent this action.

 

This suggests that there is a magic way of moving files from Windows to a SAS Server. Does anyone know what SAS does behind the scenes here? Or if there is another solution? Even if I could just get some libnames it would be a great help.

 

Thanks and have a great day.

 

Matt

Community Manager
Posts: 2,697

Re: Upload Code

EG uses some SAS APIs to do this work, not SAS program code.  There isn't SAS code that can move files from your local desktop to a SAS session unless you have a shared network location that you can reference, such as a UNC path or mapped drive.

 

The Copy Files task can easily copy these files for you in one step, if they are all together in the same folder.  

Esteemed Advisor
Posts: 6,685

Re: Bulk uploading csv files from Windows to SAS Server

In order to use a SAS workspace server, an operating system account is needed. Servers usually have SSH daemons running, so you could try a SSH capable file transfer utility using your SAS account to get the files to the SAS server.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Respected Advisor
Posts: 3,063

Re: Bulk uploading csv files from Windows to SAS Server

If your SAS server is Windows-based then a simple solution is to get your SAS admin to create a file share for the server folder. Then you can simply go into Windows Explorer on your PC and select all 600 files then do a copy and paste to the server file share. We do this all the time and it is fast and easy.

New Contributor
Posts: 4

Re: Bulk uploading csv files from Windows to SAS Server

Thanks! And yes this is the temporary workaround I'm using but for a daily refresh which begins late evening it's not a great long term solution.

 

Thanks again,

Matt

Respected Advisor
Posts: 3,063

Re: Bulk uploading csv files from Windows to SAS Server

I certainly wouldn't recommend it as a long term solution either. Regular production processes should be server-based and not involve PCs as @Patrick has already suggested.

Respected Advisor
Posts: 3,837

Re: Bulk uploading csv files from Windows to SAS Server

If your end goal is the implementation of DI jobs for an ongoing production worthy job then having some manual EG steps in this process is imho not acceptable. 

 

You will need to find a storage location for your source .csv files which is accessible for the SAS Server on which your SAS code is running (like a share as suggested by others).

 

If these are source .csv files then eventually you can also ask yourself who's actually responsible to provide these .csv files in a location easily accessible to you. Make sure you have such things clearly defined and agreed upon as part of an interface contract.

 

New Contributor
Posts: 4

Re: Bulk uploading csv files from Windows to SAS Server

Thanks, Patrick. Completely agree and fingers crossed can get to that stage.

Ask a Question
Discussion stats
  • 7 replies
  • 554 views
  • 9 likes
  • 5 in conversation