BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Is there a way of creating an excel workbook for each change in the value of the by variable in proc report?

Any help would be much appreciated.

Thanks
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
You could investigate the NEWFILE= option, which works with most Markup destinations.

With this code, I get 1 file for each by group: msrep1.xls thru msrep10.xls for the MSOFFICE2K HTML files and xprep1.xls thru xprep10.xls for the TAGSETS.EXCELXP XML files (using SASHELP.SHOES).

cynthia

[pre]
ods msoffice2k file='c:\temp\msrep1.xls' style=sasweb newfile=bygroup;
ods tagsets.excelxp file='c:\temp\xprep1.xls' style=sasweb newfile=bygroup;

proc report data=sashelp.shoes nowd;
title 'Report for #byval(region)';
by region;
column region product sales;
define region /group;
define product /group;
define sales /sum;
rbreak after / summarize;
run;

ods _all_ close;
[/pre]

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
  • 549 views
  • 0 likes
  • 2 in conversation