Desktop productivity for business analysts and programmers

transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

Accepted Solution Solved
Reply
Highlighted
Contributor
Posts: 39
Accepted Solution

transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

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


Accepted Solutions
Solution
‎03-06-2018 04:16 PM
Community Manager
Posts: 3,424

Re: transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

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.

View solution in original post


All Replies
PROC Star
Posts: 1,307

Re: transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

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

Contributor
Posts: 39

Re: transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

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              

Trusted Advisor
Posts: 2,124

Re: transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

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.

Solution
‎03-06-2018 04:16 PM
Community Manager
Posts: 3,424

Re: transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

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.

PROC Star
Posts: 1,307

Re: transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

Posted in reply to ChrisHemedinger

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

SAS Employee
Posts: 302

Re: transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

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...

Contributor
Posts: 39

Re: transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

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).
Contributor
Posts: 39

Re: transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

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

Community Manager
Posts: 3,424

Re: transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

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.

Contributor
Posts: 39

Re: transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

Posted in reply to ChrisHemedinger
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.
Community Manager
Posts: 3,424

Re: transfer/copy a large text file from SAS Unix SAMBA folder to a Windows network folder

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.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 11 replies
  • 335 views
  • 5 likes
  • 5 in conversation