BookmarkSubscribeRSS Feed
CurtisER
Obsidian | Level 7

In 9.4M3, ODS EXCEL is new.

 

Previously, ODS Tagsets.ExcelXP has been the mainstay for generating Excel spreadsheet.  I would like to refer to SAS KB #44126 "ASIS=ON does not maintain leading or trailing blanks in the output generated by the ExcelXP tagset".

 

It appears that ODS EXCEL still does not honor ASIS=ON or PRETEXT options in the CALL DEFINE statement.  If so, I would have to continue to use Tagsets.ExcelXP?  Thanks.

1 REPLY 1
SuzanneDorinski
Lapis Lazuli | Level 10

I used the code from that SAS Knowledge Base note you referenced.  The note suggests a workaround using the MSOffice2K tagset. I ran that PROC REPORT code using the ODS Excel destination in SAS University Edition, and it works!  Smiley Happy

 

This is the code I tried: 

 


%let path=/folders/myfolders/ODS Excel examples;

ODS EXCEL FILE="&path/Use ASIS=ON.xlsx";
 
proc report data=sashelp.cars nowd;  
   col origin cylinders mpg_highway mpg_city;
   define origin        / group;
   define cylinders     / group;
   define mpg_highway   / mean format=4.; 
   define mpg_city      / mean format=4.;  
                            
   compute origin;    
      if origin ne "Europe" then do; 
         call define(_col_,"style","style={pretext='   ' asis=on}"); 
      end; 
   endcomp; 
run;

ODS EXCEL CLOSE;

And this is the output:

 

Use ASIS=ON in ODS Excel.jpg

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 1891 views
  • 0 likes
  • 2 in conversation