BookmarkSubscribeRSS Feed
alandool
Quartz | Level 8
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.
8 REPLIES 8
Doc_Duke
Rhodochrosite | Level 12
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
alandool
Quartz | Level 8
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
SASKiwi
PROC Star
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.
ChrisNZ
Tourmaline | Level 20
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
alandool
Quartz | Level 8
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
SASKiwi
PROC Star
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.
Doc_Duke
Rhodochrosite | Level 12
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.
qian
Calcite | Level 5

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 2090 views
  • 0 likes
  • 5 in conversation