Help using Base SAS procedures

Sas crashes after running this code

Reply
Super Contributor
Posts: 259

Sas crashes after running this code

The
ods _all_ close;
ods tagsets.ExcelXP path='\\Netapp4\Sasdata\Risk Modelling\CL Fleet\ROI\2014\00 - Main DWH\Enhanced DWH' file='Claims_dists.xml'
style=Printer;
%macro sheets(var);
ods tagsets.ExcelXP options(sheet_name="&var");
proc print data=&VAR._DIST noobs style(Header)=[just=center];
run; quit;
%mend;
%sheets(OWN);
%sheets(TPI);
ods tagsets.ExcelXP close;
Super User
Posts: 19,789

Re: Sas crashes after running this code

You should talk to tech support, there are too many things to check.

ie.

Does the macro run without using tagsets?

Do you have the latest version of tagsets?

What version of SAS?

Is the code running and then crashing as the file tries to open the XML file?

Super Contributor
Posts: 259

Re: Sas crashes after running this code

The macro runs fine and produces the multisheet excel file no problem. It's only when i run something else in sas that it takes ages to do anything and I have to close out of it.

I use the Base version.

Super User
Posts: 11,343

Re: Sas crashes after running this code

How many records are you printing? SAS be default tries to open you output and it may be taking a long time to render. Also if you exceeded the number of rows of the program that may be trying to display the data (Excel anyone?) that process is hanging.

The superfluous quit; shouldn't be causing an issue.

Have you run this without the macros as 2 proc print calls within the tagsets.excelxp?

Or with file='\\Netapp4\Sasdata\Risk Modelling\CL Fleet\ROI\2014\00 - Main DWH\Enhanced DWH\Claims_dists.xml'

instead of Path and file?

Super Contributor
Posts: 259

Re: Sas crashes after running this code

I know why it is happening now but I don't know how to stop it. Loads of script is being generated in the Reviewer and even once the xms files are created the Reviewer keeps being populated with code.

In terms of size, the files have 6000 rows and 4/5 columns.

Is there some code I can use to stop the Reviewer generating script.

My intention, once the XML files are created is to convert them to xlsx.

Super User
Super User
Posts: 7,952

Re: Sas crashes after running this code

I am a bit confused by your post.  What is the "Reviewer"?  As for your intention, XLSX files are merely a ZIP of XML files in Open Office format.  Also, you can achieve a multi-sheet output by using:

SHEET_INTERVALTableInterval to divide the output between worksheets. Values are Table, Page, Bygroup, Proc, or None

So you may not need to generate the code, set all your data together with a title column, then do a proc report by.

Super User
Posts: 19,789

Re: Sas crashes after running this code

Go into options and turn off the setting that states - View results as generated.

Ask a Question
Discussion stats
  • 6 replies
  • 300 views
  • 0 likes
  • 4 in conversation