BookmarkSubscribeRSS Feed
sasstar
Calcite | Level 5

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

5 REPLIES 5
LinusH
Tourmaline | Level 20

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.

Data never sleeps
sasstar
Calcite | Level 5

Thanks for the note what is filename pipe. Can you please provide an example.

SASKiwi
PROC Star

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.

sasstar
Calcite | Level 5

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.


Kurt_Bremser
Super User

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1467 views
  • 0 likes
  • 4 in conversation