Using SAS University Edition:
1) Trying to specify font, etc in Title , but getting the error message below saying that Arial, etc is not available.
Error message in green below. I coloured the code in red.
2) Xaxis table: It looks fine in the output, or when I save it to HTML, although when I save to PDF, the bottom line is bold, and all the italics are in Normal style. Two screenshots are enclosed to show the difference.
Should I be doing something else in proc template or do I need to use a macro to add fonts?
proc template;
define style mystyle;
parent=styles.sasweb;
class graphwalls /
frameborder=off;
class graphbackground /
color=white;
end;
run;
ods listing close;
ods html style=mystyle path='.' file='newgraph.html';
ods graphics / reset=all border=off width=640 height=480;
proc sgplot data =Heerdt.VPPlotsforSAS1 (where=(level=2)) nowall noborder ;
Title "OR (95% upper CI) for composite estimate of Severe Vasoplegia over 24h (shaded), and at specified times up to 24 hours,
by preoperative blood pressures" Font=Arial color=black;
styleattrs datacontrastcolors=(CX18577A CX30CC6E CX666666 CXFFA700 ) ;
scatter x=Vp y=OR / yerrorupper=UCL
yerrorlower=LCL
group=Blood_Pressure1 groupdisplay=cluster clusterwidth=0.6 noerrorcaps markerattrs=(symbol=circlefilled size =5 ) ;
xaxis type =discrete;
xaxis display =(noticks nolabel noline) VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Normal Weight=Normal);
yaxis display =(noticks nolabel noline) VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Normal Weight=Normal);
refline 1.0 / axis=y discretethickness=1 lineattrs=(color=cxd0e0f0);
refline "24h" / axis =x discretethickness=1 transparency=0.8 lineattrs=(color=cxd0e0f0);
xaxistable total_char c2_char missing_char / location=outside VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Italic Weight=Normal);
keylegend /valueattrs=(size=10) title ="Blood Pressure" location =inside position=bottomright noborder down=1 title ="";
run;
I think if you check the SAS UE limitations this is one of them.
https://support.sas.com/software/products/university-edition/faq/limitations.htm
Since SAS UE is in a locked down state, I don't think you're able to add fonts as you would in a fully licensed SAS installation.
Along similar lines:
I have a new figure / table:
Y axis is discrete.
I want the order to be the reverse of what we have now.
Looked at
This is all I can see that is relevant:
DISCRETEORDER=DATA | FORMATTED | UNFORMATTED
specifies the order in which discrete tick values are placed on the axis. This option affects any plot with a discrete axis. Specify one of the following values:
places the values in the order in which they appear in the data.
sorts the formatted values in ascending character order.
sorts the unformatted values in ascending character order.
Default | UNFORMATTED |
Is there anything I can do to reverse this order?
proc sgplot data =VP_Table2b2 (where=(Severity ="Severe"))nowall noborder ;
Title "OR (95% CI for covariates across Vasoplegia Severity" Font=Arial color=black;
scatter x=OR y=Name / xerrorupper=UCL xerrorlower=LCL
noerrorcaps markerattrs=(symbol=circlefilled size =5 ) ;
yaxis type =discrete reverse;
xaxis display =(noticks nolabel noline) VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Normal Weight=Normal)type =log logbase =e;
yaxis display =(noticks nolabel noline) VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Normal Weight=Normal);
refline 1.0 / axis=x discretethickness=1 lineattrs=(color=cxd0e0f0);
yaxistable pdp2_char ORr LCLr UCLr / location=outside VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Italic Weight=Normal); run;
Thats fine, but is there anything I can do about the table font changing when I save it as a PDF?
Looks like we have the same issue with the bold font in the last column of the table I just uploaded.
Only seems to happen when I save to PDF, even though it looks OK in the output.
when I save to PDF
How are you 'saving' to PDF, I assume you're using ODS PDF? Does Adobe issue any note/message/errors about changing the fonts, that sometimes happen if the fonts used aren't available to your PDF application.
Usually I press on the pdf "download results as a pdf file" button in the results window, between the RTF and word buttons.
It may be because this is a locked down version, although I thought it unlikely at first since the font in results is as I specified .
However....I did try this just before the proc sgpolot data line after creating a file on my desktop to save pdf files in.
ods pdf file ="/Users/Desktop/My SAS PDF Files";
NOTE: ODS statements in the SAS Studio environment may disable some output features.
73
74 ods pdf file ="/Users/Desktop/My SAS PDF Files";
ERROR: Unable to open filename /Users/christoskoutentis/Desktop/My SAS PDF Files. ODS PDF initialization fails.
ERROR: The path /Users/christoskoutentis/Desktop/My SAS PDF Files is not in the list of accessible paths when SAS is in the
lockdown state.
At least we now know more about whet cant be done in sas studio.
Any idea about getting axis tables in proc sgpanel? I found a colaxis tableoption, but its not what the same as we have in procsgplot.
Also, still cant reverse the border or the variables on the Y axis (it is discrete), and I would like to align them on the left. of possible.
Lastly, can I change the alignment of the numbers in the axis tables? Ideally I would like to have the confidence intervals in brackets separated by a comma rather than a column for each values. I guess I can put those numbers with brackets etc and use that as a character variable.
I don't know the answers to your other questions, but for ODS PDF, you have your path incorrect. When working in SAS UE you need to use the shared folder you set up at installation and the path using the myfolders.
'/folders/myfolders/mydemo.pdf'
The file will be wherever you set up the shared folder.
Yes, you can use ROWAXISTABLE and COLAXISTABLE in SGPANEL. If you want special formatting of the values in the table, you will have to construct the test string yourself in a column, and use that to display the values in the axis tables. See the 2nd column in this example of Forest Plot.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.