Desktop productivity for business analysts and programmers

export pipe delimited file from Unix SAS EG server to network drive

Reply
Contributor
Posts: 24

export pipe delimited file from Unix SAS EG server to network drive

Hi All,
This is within EG 4.2. I am trying to move a large SAS dataset on a SAS EG server into a pipe delimited text file and move this text file to a Windows network drive. Need to know how this can be accomplished. Have already tried several methods, but no luck so far.
Valued Guide
Posts: 2,111

Re: export pipe delimited file from Unix SAS EG server to network drive

I think that you have to write a little code. I don't find an option for pipes in the Export tools in EG 4.2. You may be able to do it with ODS CVS (I've not tried that).

You can certainly do it with the %ds2csv macro that you can download from support.sas.com.

Doc Muhlbaier
Duke
Contributor
Posts: 24

Re: export pipe delimited file from Unix SAS EG server to network drive

Thanks Doc. Right now I'd be happy with some sample code showing how to move a file from a SAS Unix server to a Windows environment (to a network folder).

Creating a pipe delimited file is one thing. Moving it between a SAS Unix server and a Windows network seems to be another (haven't work with Unix before).

You are correct, EG 4.2 does not have an option for pipe delimited files.

Alan
Respected Advisor
Posts: 3,060

Re: export pipe delimited file from Unix SAS EG server to network drive

I suggest you explore FTP (File Transfer Protocol) as a way of moving your files from Unix to Windows. FTP is built into both operating systems and you can get SAS to do the FTP for you using a FILENAME statement with the FTP option.

The first thing you will need to check out is can you logon to your Windows network from your Unix server. Since you haven't worked with Unix before I suggest you get help from other Unix users at your site to confirm you can do this. From a Unix command line you can test a Windows connection by typing ftp then type open . It will then prompt you for a userid and password.
Trusted Advisor
Posts: 1,508

Re: export pipe delimited file from Unix SAS EG server to network drive

Another option is to have a directory on your unix box shared by samba and visible from windows boxes using a UNC path.
For eg you share
/usr/sambashares/egexports
and you can see
\\unixbox\egexports
Contributor
Posts: 24

Re: export pipe delimited file from Unix SAS EG server to network drive

Hi SASKiwi,

I cannot "open" the Windows server from the Unix command line. Being told "A remote host refused an attempted connect operation." I have access to a folder on this Windows server. Wondering why I cannot open. Any idea?

Alan
Respected Advisor
Posts: 3,060

Re: export pipe delimited file from Unix SAS EG server to network drive

Hi Alan,

Try to ping the Windows server from the Unix command line: ping . If this doesn't work then your Unix server cannot identify your Windows server. This is a job for your IT network administrators to solve, not you. From the message you quote I suspect ping will work.

If you can successfully ping then the Windows server is blocking your FTP logon request and you need to get a Windows administrator to enable FTP remote logins to that server. Many organisations tightly control this so I am not surprised it is blocked by default.
Valued Guide
Posts: 2,111

Re: export pipe delimited file from Unix SAS EG server to network drive

The samba approach works fine, but does require that the UNIX admin set it up. It also is much easier if the UNIX box and the windows network are on the same subnet. A samba limitation is that the end-of-line character on UNIX is different from the end-of-line characters on the PC, so some Windows programs (like NotePad) get confused.

One technique that I have used is to create the file in UNIX and store it and then run an ftp session from the Windows workstation to bring the file over to Windows. Windows IT admins often "turn off" incoming FTP, so you can only "get" things and not "put" things. For repeated production activities, I will use the cron on UNIX to run the SAS job to create the file and scheduled tasks on windows for a .BAT file to execute the ftp session.
Occasional Contributor
Posts: 6

Re: export pipe delimited file from Unix SAS EG server to network drive

Do you have 'Attachmate Reflection FTP Client ", it can easily tranfer data between UNIX SAS and local network.

Ask a Question
Discussion stats
  • 8 replies
  • 808 views
  • 0 likes
  • 5 in conversation