Desktop productivity for business analysts and programmers

How to write resultset (csv files in this case) onto an FTP server

Reply
Occasional Contributor
Posts: 7

How to write resultset (csv files in this case) onto an FTP server

Hi,

I have my output of analysis in SAS folders, however I want to export them to an external location (through ftp client) to be consumed by application. Can this be done in EG itself or do I need to do that externally. If yes, how can it be done?

Gnyanendra

Regular Contributor
Posts: 184

How to write resultset (csv files in this case) onto an FTP server

Occasional Contributor
Posts: 7

How to write resultset (csv files in this case) onto an FTP server

Hi Howles, The link that you provided directs one to Base SAS reference directory. The code there is definitely helpful, but I was thinking of getting it done from SAS EG, as I dont have Base SAS. So my question is whether it can be done from UI in SAS EG or one will have to edit the code to get it done.

thanks

Super User
Super User
Posts: 6,381

How to write resultset (csv files in this case) onto an FTP server

Obviously you do have Base SAS or else your Enterprise Guide would have no where to send the SAS code that it generates.

Are you asking if there is GUI interface in EG that you can use rather than just building a SAS program step into your EG project file?

Occasional Contributor
Posts: 7

How to write resultset (csv files in this case) onto an FTP server

Tom, definitely I did not understand earlier that there has to be Base SAS to run the code. Also, indeed I was asking the same that whether it can be done from UI.

Valued Guide
Posts: 2,111

How to write resultset (csv files in this case) onto an FTP server

In short, no.  The UI does not have a direct method to use FTP.  You can follow Tom's suggestion or you can, if you EG admin permits, launch an "X" command to run FTP from the SAS server.  The discussions in this thread might be helpful.

http://communities.sas.com/thread/32788?tstart=0

Another approach, much less direct, is to deposit the output into a directory that has it's contents periodically FTP'd by a separate process.  Again, it is not using the UI, but it gets the job done.

Doc Muhlbaier

Duke

Occasional Contributor
Posts: 7

How to write resultset (csv files in this case) onto an FTP server

Hi Doc,

I tried writing to FTP in code itself, but faced these errors.

filename resultSet

ftp 'C:\Users\sas\resultSet.csv'

CD='/SASUpload' USER='guest'

PASS="guest" HOST='ftp.domain.com' rcmd=binary;

run;

proc cport library= abc_xyz file=resultSet;

run;

ERROR: The connection was reset by a peer..

ERROR: Invalid logical name.

ERROR: Error in the FILENAME statement.

ERROR: "RESULTSET" is not a valid name.

Valued Guide
Posts: 2,111

How to write resultset (csv files in this case) onto an FTP server

"resultset" is too long.  shorten to 8 or fewer characters.  If still getting errors, call tech support.

Ask a Question
Discussion stats
  • 7 replies
  • 358 views
  • 0 likes
  • 4 in conversation