Desktop productivity for business analysts and programmers

Export sas dataset into excel on a shared drive.

Reply
New Contributor
Posts: 3

Export sas dataset into excel on a shared drive.

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

Super User
Posts: 5,375

Re: Export sas dataset into excel on a shared drive.

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
New Contributor
Posts: 3

Re: Export sas dataset into excel on a shared drive.

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

Super User
Posts: 3,233

Re: Export sas dataset into excel on a shared drive.

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.

New Contributor
Posts: 3

Re: Export sas dataset into excel on a shared drive.

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.


Super User
Posts: 7,371

Re: Export sas dataset into excel on a shared drive.

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@hostnameSmiley Tongueath_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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 5 replies
  • 479 views
  • 0 likes
  • 4 in conversation