Hello everyone, I'm sharing a workaround for a frustrating issue with the SAS Enterprise Guide "Copy Files" task and also asking the community if a better, automated solution exists. The Problem I was using the "Copy Files" task to move a file from a Windows network share (UNC path) to a SAS Linux server. The task consistently failed with a "file not found" error, even though the SAS log showed that the macro variable containing the full source path was 100% correct. The Root Cause After days of troubleshooting, I discovered that the problem was not the path, not special characters, but a bug in the task itself related to the length of the source filename. The "Copy Files" task seems to have a hidden character limit and fails to read a source file from a UNC path if the filename is too long. My Manual Workaround (The only thing that worked) The only way I could get the process to work was to: Go into the original Windows folder on the network share. Manually rename the source file to have a shorter name. Run the "Copy Files" task again, pointing to the file with its new, short name. It worked instantly. My Question for the Community Obviously, this manual workaround is not a viable solution for an automated, recurring process. So, my question to the forum is: Has anyone found a way to automate a solution for this bug from within SAS? I'm thinking of things like: Is there a hidden option or a different SAS command that can force the "Copy Files" task to correctly read long filenames from a UNC path? Is there a reliable way to use SAS code (e.g., X command, FILENAME PIPE) to remotely rename the source file on the Windows share before the "Copy Files" task runs? I'm skeptical this is possible due to security permissions, but I'm open to ideas. Essentially, how can we handle this file transfer in an automated way when the source filename is too long for the "Copy Files" task to handle? Thanks in advance for any suggestions.
... View more