I'm attempting to vertical align columns of text and a formatted color dot through proc report through the "vjust" style option but "vjust" seems to have no effect on my output.
proc format;
value cfmt
0='red'
0.000001-0.999999 ='yellow'
1='green'
;
value dot
low-high='^{style [vjust=c fontsize=20pt]^{unicode 25cf}}';
run;
ods escapechar="^";
PROC REPORT DATA=compliance_lp headline headskip split='*'
style(column header summary) = {font_size=2 background=white font_face="Arial" vjust=c};
column completion_rate UT_ID;
define completion_rate/ style(column)=[foreground=cfmt. vjust=c] format=dot. ' ';
DEFINE UT_ID / group center 'Store' width=12;
run;
The formatting of the dots is working as intended but I cannot get the dots center aligned with the text of the rest of the columns.
Any help would be appreciated.
I see that you have a bit "
If you want better responses you might provide example data so we can test and modify code or use a SAS supplied data set for examples. Without data we can't actually test your code.
Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.
Also you may want to tell us what ODS style is in effect.
Here is a sample dataset and code that is producing the same issue:
data weight2;
infile datalines missover;
input IDnumber $ Week1 Week16;
WeightLoss2=Week1-Week16;
datalines;
2477 195 163
2456 173 155
2412 135 116
;
proc format;
value cfmt
0-140='red'
140-180 ='yellow'
180-200='green'
;
value dot
low-high='^{style [vjust=c fontsize=20pt]^{unicode 25cf}}';
run;
ods escapechar="^";
options emailsys= ;
options emailauthprotocol=none;
options emailhost= ;
/*options emailport=25;*/
options emailID = ;
options emailpw = ;
filename temp email
to =
/* cc = */
/* bcc = */
subject="test"
type="text/html"
from = ;
title;
ODS html body=temp;
PROC REPORT DATA=weight2 headline headskip split='*'
style(column header summary) = {font_size=2 background=white font_face="Arial" vjust=c};
column Week1 IDNUMBER;
define Week1/ style(column)=[foreground=cfmt. vjust=c] format=dot. ' ';
DEFINE IDNUMBER / group style(column)=[vjust=c] center 'ID' width=12;
run;
ods _all_ close;
SAS does not seem able to render this output within SAS, so the only output I have is the actual email I am receiving through outlook.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.