Help using Base SAS procedures

Exporting data from unix to windows environment

Occasional Contributor
Posts: 12

Exporting data from unix to windows environment

Hi All,

I have a program running in UNIX environment I need to export data set directly into windows environment in form of text file with that using WINscp automatically is there any way?


Vinay Emmadi

Super User
Posts: 3,115

Re: Exporting data from unix to windows environment

I've never used WINscp but a brief Google search tells me that it is a Windows-only FTP tool so it won't work on Unix.

However I understand that FTP is available in pretty much all flavours of Unix, so you could simply use SAS's FILENAME FTP option to send text files to a Windows server/PC.

The Windows server would have to be "known" by your Unix server. For example from Unix can you PING (ping MyWindowsServerAddress or ping 111.222.333 - ) your Windows server using the IP address. 

Super User
Posts: 6,972

Re: Exporting data from unix to windows environment

Assuming that SAS is only available on UNIX, you can do that with Enterprise Guide (File - Export).

Another way is to do the export with a data _null_; step and file '$HOME/somefilename.txt';. You do all the formatting needed in the put statement(s). Then you transfer with WinSCP, which allows you to use SFTP/SSH; most UNIXen today do not run simple FTP anymore, for security reasons. With .txt, WinSCP will do the necessary character code conversions for you.

SASKiwi's method may not work for lack of a FTP server in Windows.

Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation