BookmarkSubscribeRSS Feed
RobM2
Calcite | Level 5

Hi all - my first post here.

[I have searched for this so sorry if it's a well known solution]

I have a couple of questions in using SASEG8.2 (connecting to SASCompute) to copy data files to a local destination.   FWIW this is for "local" processing before they're migrated to SASApp.   Sadly we don't have command-line level access so I can't just mount the network drive and scp them etc.

1) I'm using the Copy Files task for this but I'm finding it a bit awkward.   If it fails, I'm not getting any log / feedback as to why.   I just get the node with a red "cross" symbol and there's no log.   Right-clicking on it and selecting Extract Code brings up a code window with 4 blank lines.   Is there a setting somewhere to tell me why the task has failed?   I have made it work some times but it's not always clear why it's failed.

2) Is there a way to run the Copy Files task with code?   I have quite a few very big tables in separate libraries to copy so not easy to move to one place and use a wildcard.   Would be better if I could wrap it up in a loop and just give it a list of tables to copy.

 

Thanks

3 REPLIES 3
RobM2
Calcite | Level 5

Forgive me replying to my own post.   At least I've got the answer to the first question.   For those in the same position, the log from "Copy Task" can be found by clicking on the "Copy Task" tab.   It's not called "Log" presumably because it's a task as opposed to a piece of code.   

Question 2) (automating copy files tasks) still remains.

 

Thanks

ChrisHemedinger
Community Manager

Since this task isn't generating SAS code -- it just uses behind-the-scenes APIs to do the work -- there is not a way to automate outside of the task. It supports wildcards to cover multiple files, but not recursive subfolders actions or multiple sets of files in one go.

 

To accomplish that, you would need to use something like FTP -- which this task emulates but using the SAS APIs, not actual FTP.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
Kurt_Bremser
Super User

Copy Files is an action initiated on the client side. Everything in EG is run from EG to the server. There is no means to initiate an action in EG (like receiving a file) from the server side.

To automate data transfers from the SAS server to "external" destinations, you need a means for the transfer on the SAS server; you can use FILENAME SFTP, or have a mount established in the server filesystem to every intended final destination. Or, if system option XCMD is enabled, use scp/sftp.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 789 views
  • 0 likes
  • 3 in conversation