The SAS Output Delivery System and reporting techniques

Export sas datasets to excel workbook and share

Reply
Frequent Contributor
Posts: 120

Export sas datasets to excel workbook and share

Hi

I have 4 sas datasets ab bc ca db

 

and i have to export to excel so that te excel workbook has 4 sheets ab bc ca and i need to share the excel file to the share point location

as i dont have PC SAS and my SAS is on Citrix (Remote SAS )

 

 

can anyone pls help

Esteemed Advisor
Esteemed Advisor
Posts: 7,249

Re: Export sas datasets to excel workbook and share

Hi,

 

Wel, there are two separate questions there.

1)  Create a spreadsheet with the four tabs.

For this, what version of SAS do you have?  If before 9.4 then your best bet is to use tagsets.excelxp:

ods tagsets.excelxp file="c:\test.xml" options(sheet_name="A");
proc report...;
run;

ods tagsets.excel options(sheet_name="B");
proc report...;
run;

...

ods tagsets.excelxp close;

Now this creates a file with the extension .XML, which it should as the output is not native Excel file, but XML which can be opened in Excel.  So your users would have to remember that -  you could change to XLSX, but that just adds confusion and you will get a box open in Excel for it.

Now if you have 9.4, you can write out native XLSX files, with the libname excel statement:

http://www2.sas.com/proceedings/sugi31/024-31.pdf

 

2) Upload the documents to Sharepoint.  

For this, you will need your IT group.  First you have to have the UNC to the area on Sharepoint you want to upload to.  You then need the SAS install to have the access rights to do such an operation.  Then you should just be able to use that UNC in your file statement:

ods tagsets.excelxp file="//unctosharepoint/folder/somewher"...;

 

Frequent Contributor
Posts: 120

Re: Export sas datasets to excel workbook and share

Hi,

I have to check whether i have access to create excel file in share point . So can we export sas datasets from SAS EG which is on remote server (accessing sas from citrix link )

Ask a Question
Discussion stats
  • 2 replies
  • 342 views
  • 0 likes
  • 2 in conversation