BookmarkSubscribeRSS Feed
eramirez
Fluorite | Level 6

Hello

 

I outputted results from proc tabulate and sgplot to a pdf file.  I used ODS region to place the table and bar chart next to each other on one page.  Everything looks good except for the label for ALL (tables (ALL='Total'...), instead of total, it's using a label for another variable?  When I don't use ODS region, it resolves that issue.  Not sure what I'm missing or if there is a better way to output the table and graph side by side that doesn't require ODS region? Any tips would be appreciated.  Thanks!

%let todaysDate1 =  %sysfunc(today(), DATE9.);
%put &todaysDate1;

options orientation=landscape nodate pageno=1 leftmargin=.25in rightmargin=.25in topmargin=.25in bottommargin=.25in;
ODS pdf file="C:\ODSRegionOutput..pdf" style=journal bookmarklist=none pdftoc=2;
ODS layout start columns=2;
ODS region;
proc tabulate data=dataset1;
	class newage/missing preloadfmt mlf order=data s=[font_style=italic font_weight=bold CellWidth=200];
	class newrace/missing preloadfmt mlf order=data s=[font_style=italic font_weight=bold ];
         class Gender/missing mlf order=data s=[font_style=italic font_weight=bold ]; 
	class resident/missing mlf order=data s=[font_style=italic font_weight=bold];
	tables (ALL='Total' newage='Age' newrace='Race/Ethnicity' Gender='Sex' resident='Residence'),( N colpctn='(%)');
	format newage age. newrace racegrp.;
run;
ODS graphics on/ width=5.5in height=4in noborder;
ODS region;
proc sgplot data=dataset1;
	vbar date/ stat=sum  datalabelfitpolicy=rotate datalabel;
	xaxis label='Date' values = ('20DEC2020'd to  "&todaysDate1"d by day) valueattrs=(size=7pt);
	yaxis label='Number' ;
	format date MMDDYYS.;
run;
ODS graphics off;

ODS layout end;
ODS pdf close; 
2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

We ca't replicate as you use date we don;t have access to, but from your description this looks like a bug.

You should contact SAS Tech Support.

eramirez
Fluorite | Level 6

Thank you.  I contacted SAS support and indeed it is a bug.  It has been reported.  I used the columns=  option and it worked. 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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