Hi All, i faced with a problem when creating .pdf output. At the moment output looks like this:
But i have to remove "~" symbols. For .rtf format it is working correctly ,just using escapechar="~". Is there any way to remove "~" using soome options or parameters in "ods pdf" ?
code:
%if &form=pdf %then %do;
ods pdf file="&path.out/&prefix. Incidence of all Adverse Events.pdf" style=Journal;
%end;
OPTIONS PAPERSIZE=A4 ORIENTATION=Portrait linesize=max;
ODS escapechar="~";
options missing=' ';
proc report data=final style={protectspecialchars=yes} nowd missing split='@';
columns col1 col2 col3 col4 ;
define col1 / display left 'System Organ Class@ Preferred Term' ;
define col2 / display center 'Number @ of Patients' ;
define col3 / display center 'Percentage @ of Patients';
define col4 / display center 'Number @ of Events';
run;
ods &form close;
I tried to use col1='a0'x||strip(col1); but it is working really strange, for some rows it is adding 1 blank and in some rows it is deleting combination of letters 'an' even in header ))).
Also i tried to use: col1= ' ~{nbspace 4} ' ||strip(col1); but in output it appeares as a text.
If the ~ is embedded in the column, have you tried using the tranwrd function ot take it out of the text string? It would work like this:
NewVar=tranwrd(Yourvar,'~','');
If the '~' is embedded in the column, have you tried using the tranwrd function ot take it out of the text string? It would work like this:
NewVar=tranwrd(Yourvar,'~','');
Thank you all for your attention! I found the solution :
col1='a0'x||'a0'x||'a0'x||'a0'x||'a0'x||strip(aeterm_pt); it is adding 5 spaces , but it works correctly for .pdf and .rtf when using next options in proc report definition:
proc report data=final style={protectspecialchars=on} nowd missing formchar(2)='_' split='@';
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.