I am sending SGPANEL output (along with some title and proc print output) to a PDF file.
I have figured out all of the formatting except for two minor items.
1. At the bottom right of the SGPANEL output there is text "Page of" that I cannot get rid of. This is not the page label for the PDF pages, it is embedded in the SGPANEL output. The output chart is only one page and thus requires no pagination. The "Page of" text appears in both the PDF file and the HTML that shows up in Enterprise Guide. I am using SAS 9.4x. I do not want to format this item, I just want to remove it.
2. The COLAXIS label appears properly centered in the HTML output but in the PDF file it is centered on the bottom row of charts rather than across both rows of my two row/three column SGPANEL output.
Here is the relevant code:
ods pdf file="s:\want.pdf" startpage=no notoc dpi=600;
ods graphics / reset=all height=4in width=6in noborder;
ods escapechar = '^';
options nodate nonumber;
%let VarName = SomeVariable;
proc sgpanel data=&VarName._DistPct NOAUTOLEGEND;
panelby As_of_Date / onepanel;
styleattrs datacolors=(blue)wallcolor=pink;
vbar &VarName._Bin / response=Percent group=ColorDummy;
rowaxis grid label="Aggregate Current Balance Percentage" valuesformat=comma6.0 labelattrs=(size=12pt) labelpos=center;
colaxis grid discreteorder=data fitpolicy=rotatethin label="&VarName." labelattrs=(size=15pt) valueattrs=(size=12pt);
run;
Some of the options may be unnecessary. I started throwing the kitchen sink at the problem when I could not find an answer in the documentation or forums.
I appreciate your help and any references to appropriate documentation.
Your example code removed the TITLEs. Try removing the FOOTNOTEs also.
title;
footnote;
I think I would like to see the LOG from the ODS PDF through the ODS PDF Close statement. Note the code, LOG when it executes and generates the problematic output.
I don't see any ODS PDF CLOSE above so I am wondering if you are just seeing the same document created, or the previous one left open and not generating a new document at all.
Hi:
I don't see any TITLE or FOOTNOTE statement in your code. Are you using Page X of Y Escapechar strings in any other code that you run? Is this code part of a bigger job or possibly a macro program? Again, seeing your whole log and any error messages or a screen shot of the "bad" output would be useful.
Cynthia
Here is sample program that highlights the issue:
data sample;
length Brand $ 6 MPG 8 Season $ 6;
input Brand Season MPG;
cards;
Ford Winter 10
Ford Spring 14
Ford Summer 20
Ford Autumn 15
GMC Winter 12
GMC Spring 18
GMC Summer 18
GMC Autumn 12
Toyota Winter 8
Toyota Spring 16
Toyota Summer 22
Toyota Autumn 18
;
run;
title;
proc sgpanel data=sample NOAUTOLEGEND;
panelby Season / onepanel;
styleattrs datacolors=(blue)wallcolor=pink;
vbar Brand / response=MPG;
rowaxis grid label="Aggregate Mileage" valuesformat=comma6.0 labelattrs=(size=12pt) labelpos=center;
colaxis grid discreteorder=data fitpolicy=rotatethin label="Brand" labelattrs=(size=15pt) valueattrs=(size=12pt);
run;
The screenshot below highlights the text I am trying to eliminate (prior post was rejected as spam. Not sure if that was because of the image or the log)
Sorry, I'm new at posting here. I have attached a file with the image and log.
Thanks for your help
Your example code removed the TITLEs. Try removing the FOOTNOTEs also.
title;
footnote;
Brilliant! Thank you.
I figured there was no footnote if I did not specify one but apparently it is there by default.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.