Hi,
I'm trying to write a report as a PDF that includes a Greek character (mu) for microgram. All looks well in the output window, but when the PDF is generated things get messy.
Here is some code to describe what I'm talking about:
data medication;
length drug $25;
input patient $ drug $ route dose units;
datalines;
GWa Aripiprazole 3 9.75 1
JAd Adalimumab 2 40 1
TJe Esomeprazole 1 40 1
JMa Rosuvastatin 1 10 1
JMo Etanercept 2 50 1
JQA Salmeterol 5 50 4
AJa Infliximab 4 100 1
MVB Insulin 2 10 5
WHH Filgrastim 2 15 4
JTy Glatiramer 2 20 1
JKP Rituximab 4 50 1
ZTa Tiotropium 5 18 4
MFi Sitagliptin 1 25 1
;
proc format;
value unit
1 = 'mg'
2 = 'g'
3 = 'ml'
4 = '~{unicode 03BC}g'
5 = 'other'
;
value route
1 = 'oral'
2 = 'subcu'
3 = 'IM'
4 = 'IV'
5 = 'inhaled'
6 = 'nasal'
7 = 'transdermal'
8 = 'eye'
9 = 'other'
;
run;
ods pdf
author = "POTUS"
title = "Report of Medications"
style=Pearl
pdftoc = 1
uniform
/* file="C:\Users\XXX\GreekTest.pdf" */
;
options orientation=portrait nonumber nodate missing='' ;
options dtreset;
ods listing close;
ods escapechar='~';
title j=c "Table of Medications ";
proc report data=medication nowd headline headskip formchar (2)="_" spacing=2 split='|' style(report)=[fontsize=8pt] ;
column
patient
drug
dose
units
route
;
define patient / order style(column)= [ cellwidth=2.5cm] "Patient Identifier";
define drug / style(column)= [just=left cellwidth=3.5cm] "Medication";
define dose / style(column)= [just=center cellwidth=2.2cm] "Dose" ;
define units / style(column)= [just=left cellwidth=2.2cm] "Units" format=unit.;
define route / style(column)= [just=right cellwidth=2.2cm] "Route" format=route.;
run;
Here is the view of the table from the output window:
And here is the table in the PDF:
Why are the units no longer aligned?
SAS v9.4 running in Windows 7 x64
Norman.
Is it your PDF viewer? I'm assuming Adobe, it doesn't always play nicely with symbols, there's something about embedding fonts I had to deal with once for something like this.
Interesting idea, but how do I test it?
I've attached the file.
Norman.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.