BookmarkSubscribeRSS Feed
mmohotsi
Obsidian | Level 7

Good day 

I am trying to create multiple sheets using ods excel in proc sgplot. The code is as follows.

 

%Let Dated = '10Feb2023'd;
%let date1=%sysfunc(today(),date9.);
%Let reports = <path>;
ods _all_ close;
ODS excel FILE = "&reports\Blending &date1 .xlsx";
OPTIONS PAGESIZE=MAX ORIENTATION=LANDSCAPE;
ods graphics on / width=11in height=6in noscale;

ods excel options(autofilter="ALL" sheet_name = "Parameter " embedded_titles='yes');
proc sgplot data=tested (where=(NAME='Parameter' ));
vline dates / response=NUMERIC_ENTRY group=sampling_point groupdisplay=cluster ;
yaxis values=(0 to 200 by 20) label='Parameter' grid LABELATTRS=(weight=bold family=Helvetica size=7)
VALUEATTRS=(family=Helvetica size=7 style=normal weight=normal ) ;

refline &Parameter / axis=y label=('Units') lineattrs=(color=green pattern=dash) labelattrs=(size=7) labelloc=inside;
refline &Dated / axis=x label=('Blending date') lineattrs=(color=red pattern=dash) labelattrs=(size=7) labelloc=inside;
xaxis interval=day VALUESROTATE=VERTICAL
label='Sampled dates' LABELATTRS=(weight=bold size=7) valuesrotate=vertical
VALUEATTRS=(family=arial size=10 style=normal weight=normal )
type=time ;
title1 j=c "Parameter trend" bold;
run;
ods _all_ close;

 

My challenge is that I could only create 8 excel sheets using the above code.

 

Is there a way of getting more sheets on the one workbook? I need close to 70 work sheets on one workbook.

2 REPLIES 2
yabwon
Meteorite | Level 14

Maybe this will help:

proc sort data = sashelp.cars out = cars;
  by Origin;
run;

ods excel file="R:\text.xlsx"
GFOOTNOTE
GTITLE
options(SHEET_INTERVAL='NONE') /* prevent by group sheet break*/
;
options nobyline;

title1 j=c height=1 font="Courier New" 
  "Title Origin: #byval(Origin).."
;
footnote1 j=c height=1 font="Courier New" 
  "Footnote Origin: #byval(Origin).."
;
proc sgplot data=cars;
  by Origin;
  scatter x=Invoice y=MSRP;
run;


ods excel close;

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



PaigeMiller
Diamond | Level 26

I don't see how the code you present will produce more than 1 plot, but you say it works for up to 8 plots, but not more??? How does this code produce 8 plots? What happens when you ask for more than 8 plots, is there an error in the log? If so, please show us the ENTIRE log for this ODS EXCEL.

 

Also, please try it with

 

ods excel options(sheet_interval='PROC');

 

or

 

ods excel options(sheet_interval='PAGE');
--
Paige Miller

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 126 views
  • 0 likes
  • 3 in conversation