BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
alandool
Quartz | Level 8

Hi,

 

We have a need to transfer/copy a large text file from our SAS Unix SAMBA folder to a Windows network folder.  I know there has to be a way to programmatically do this using SAS code -- possibly call a Python script.  Not having done this before makes it a mystery.   I appreciate any help in regards to doing this.

 

Hope I am not asking a question that has been recently answered, but I have researched through prior questions, but only getting bits and pieces of info but not a complete picture.

 

Using:

SAS Version is 9.04.01M3P062415

Operating System is AIX 64 (AIX)

 

Alan

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

Try the built-in Copy Files task in SAS Enterprise Guide 7.13 (if you have it) or else download the custom task and apply to your environment.  Blog post here with some instructions.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

View solution in original post

11 REPLIES 11
TomKari
Onyx | Level 15

Here's what it looks like to me; please correct any incorrect assumptions

 

If your SAS server is running Unix, your Windows network folder isn't available to that server. So I can't see how SAS, or any software running on that server, could do the copy. I think you'd need to run a copy process on a Windows machine that can see both folders.

 

Tom

alandool
Quartz | Level 8

Thank you,

 

We are using SAS EG (version 7.10) in a Unix environment.  The SAMBA setup allows us to be able to see into our Unix folders like it is a Windows environment.  I am trying to eliminate any manual steps with moving a text file over from a SAMBA folder to a Windows network folder.  I would think (hope) there is a way to do that programmatically from SAS EG whether it is calling some type of script or use an X command (we do have available X command).

 

Alan              

Doc_Duke
Rhodochrosite | Level 12

Unless you also have access to a Windows SAS server, I think that you will need to do the copying outside of the SAS environment. 

 

If you need to make the file copy at the beginning or end of an EGuide session, you could create a Windows batch file that does the copy and then calls eGuide (or vice versa).

 

If you have access to a Windows SAS server, you can switch servers within EGuide and run your X-command from the Windows Server, and then go back to your *nix server.

ChrisHemedinger
Community Manager

Try the built-in Copy Files task in SAS Enterprise Guide 7.13 (if you have it) or else download the custom task and apply to your environment.  Blog post here with some instructions.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
TomKari
Onyx | Level 15

As the others have said, because you can't see the Windows folder from your Unix SAS server, there's no way to copy your file, using SAS or any other facility. If you can find a way to do it outside of SAS, let us know, and we'll try to figure out how to do the same thing from inside SAS.

 

Tom

nhvdwalt
Barite | Level 11

Unless I'm missing something, then forgive me....

 

But it seems like Samba is running on the AIX server, which means you can then see the Windows file share, right ? I had this setup going on Solaris years ago, so I'm pretty sure sure it's the same.

 

If yes, then the Windows file share shows up like any other NFS share when you use df -g. If yes, then the Windows directory is merely a another directory on AIX, which means you can copy/move/delete files like you would normally do. Yes ? cp /aix_path/myfile.txt /windows_path

 

@alandool, you mentioned a big file. How big ? In what format ? Generally NFS is not preferred for big data volumes. For archiving purposes, it's probably ok, but definitely not to process data. The moment when your AIX server has visibility on SAS datasets sitting on Windows, all and sundry is going to want to access their Windows data. Be very, very careful...

alandool
Quartz | Level 8
Seems like what you discuss is similar or same. From my Windows environment, I can map a drive to our SAS Grid Unix folder. The file I am testing with is only in MB, but I suspect the actual files will be much larger (but not big data).
alandool
Quartz | Level 8

Thank you EVERYONE for your input and help !

 

@ChrisHemedinger -- your "Copy Files" solution works quite well (after having EG 7.13 installed).  Very useful.

 

Also, I created a Python script that will move the file either way since I can map a drive to our SAS Grid Unix folder from a Windows environment.  The script sits on my desktop.  I'd prefer to have SAS EG run it, but that's another challenge (is it even possible?), and for now I am content.  Smiley Happy 

 

- Alan

ChrisHemedinger
Community Manager

We have another custom task -- System Command -- that allows you to run commands that are local to your PC where SAS Enterprise Guide is installed.  Source code is here too, if you're into that.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
alandool
Quartz | Level 8
Thank you, Chris. But, having no luck getting the add-in added into EG. Too many folders where we'd had various other installations of EG, over the years.. Just not sure where to place the .DLLs.
ChrisHemedinger
Community Manager

For a single user, drop it into:

 

 %appdata%\SAS\EnterpriseGuide\7.1\Custom (create that folder if needed)

 

Do not use the Add-In Manager -- ironically, it's not that helpful for some tasks.

 

You must also unblock the DLL first.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 11 replies
  • 3476 views
  • 5 likes
  • 5 in conversation