BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
gard111
Calcite | Level 5

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;


Proc Report output in emailProc Report output in email

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. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
Hi:
I believe the issue is that you are using 2 different font sizes, the centering is based on the font size. You have a fixed font size of 20pt for the dot and a relative font size of 2 (which each browser can translate differently) for the header and columns, etc. I think that if you make both font sizes the same, like 18pt or 20pt for both the dot and the cell contents, that the justification will be closer to what you want.

Cynthia

View solution in original post

3 REPLIES 3
ballardw
Super User

 

I see that you have a bit "Proc Report output in email" below the image. So this could also be related to email settings. Does that image reflect the appearance in the SAS Results window?

 

 

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.

gard111
Calcite | Level 5

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.

 

Capture.PNG

 

Cynthia_sas
SAS Super FREQ
Hi:
I believe the issue is that you are using 2 different font sizes, the centering is based on the font size. You have a fixed font size of 20pt for the dot and a relative font size of 2 (which each browser can translate differently) for the header and columns, etc. I think that if you make both font sizes the same, like 18pt or 20pt for both the dot and the cell contents, that the justification will be closer to what you want.

Cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2247 views
  • 0 likes
  • 3 in conversation