05-08-2015 01:39 PM
Hi I am trying to export sas eg result into an excel on a shared drive in a windows environment.
I am trying to use the x "scp....
The code runs and no error or warning messages exist in the log however the file transfer is not taking place.
Can anyone suggest why this might be happening or any similar experience in the past.
05-08-2015 02:42 PM
The X statement does not echo back your OS commands. You can use filename pipe instead. Or do a remote desktop connection to your windows server with the same account and try your scp instruction there.
05-09-2015 07:16 PM
What operating system does your SAS server use? How are you creating your Excel file in the first place - in a SAS program / process flow or from an EG menu?
Please clarify so we can help you better.
05-11-2015 09:38 AM
Thank you for the note.
I am currently writing my code in SAS-EG which is being operated on a Unix environment.
Once the final dataset is created I would like to export that dataset and create an excel spreadsheet onto a shared drive (Which is in windows environment).
Currently here is the winscp I am running.
X "scp /opt/sasusershome/myid/LPK_CCA_COMPARE_28JAN2015.xml firstname.lastname@example.org/LTBshare$/private/STRATEGIC SERVICES/StratS AWS/CCA_LPK_Compare/te...";
The log is running and not generating any error messages but no file is being written.
Can you please help troubleshoot and let me know if there is any error in my syntax or any other reasons as to why it not happening.
05-12-2015 03:05 AM
To fetch the output of an external command to the SAS log, use the following method:
filename oscmd pipe "your command 2>&1"; * 2>&1 redirects stderr to stdout, so no messages are lost;
Usually the target for scp looks like userid@hostnameath_to_target_file. Note the colon.
I also see a blank in your target path name. I'd rather avoid directory names with blanks, as they force you to use additional (single) quotes.