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.
Thanks
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.
Thanks for the note what is filename pipe. Can you please provide an example.
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.
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 myid@cirnasnap1n1.corp.samplebank.com/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.
Thank you.
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;
data _null_;
infile oscmd;
input;
put _infile_;
run;
Usually the target for scp looks like userid@hostname:path_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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: