BookmarkSubscribeRSS Feed
HitmonTran
Pyrite | Level 9

Hello,

I am having issue with pdf output.  While my rtf turned out perfectly, my pdf is leaving gaps between each variable.  I want a continuous line without adjust the width in the define statement.

 

 

pdf output:

HitmonTran_1-1643062842051.png

 

/*====PRINT REPORT=====*/

ods listing close;
ods rtf file = "&path.\&pgmname..rtf" startpage=no style= TLF_CN_9;
ods pdf file = "&path.\&pgmname..pdf" startpage=no style= TLF_CN_9;
options orientation=landscape ps=50 ls=140; title6 'Safety Population'; proc report data = final1 nowd headline headskip missing split='@' style(header column)=[protectspecialchars=off]; columns ordx1 aebodsys total1 aedecod desc ("0 mg@(N=&trtgn1)" TRTxG1 TRTG1 )("Placebo@(N=&trtgn2)" TRTxG2 TRTG2);
define ordx1 / descending order order=internal noprint; define aebodsys / order order=internal noprint; define total1 / descending order order=internal noprint; define aedecod / order order=internal noprint; define desc /display style(header)=[just=left] style(column)=[asis=on cellwidth=1.7 in ] flow " "; define TRTxG1 /display style(header)=[just=center] style(column) = [just=center cellwidth=.7 in] "Events"; define TRTG1 /display style(header)=[just=center] style(column) = [just=center cellwidth=.7 in] "Participants (%)"; define TRTxG2 /display style(header)=[just=center] style(column) = [just=center cellwidth=.7 in] "Events"; define TRTG2 /display style(header)=[just=center] style(column) = [just=center cellwidth=.7 in] "Participants (%)"; compute desc; if index(desc,' ') = 1 then do; call define(_col_, "style", "style=[asis=off leftmargin=0.25in]"); end; if index(desc,' ') = 0 then do; call define(_col_, "style", "style=[asis=on]"); end; endcomp; compute before aebodsys; line ""; endcomp; run; ods _all_ close; ods listing;
1 REPLY 1
ballardw
Super User

Does this happen if you use a style other than your custom Style=TLF_CN_9?

 

I suspect to actually work through this we will need some example data, the definition of your custom style and some values for the macro variables that are displayed in your code.

 

A wild guess might be the output is attempting to use the entire width of the page as set in your LS=140 with fewer characters. I have seen a few odd interactions between the ODS and character settings like LS.

You might consider using the PAPERSIZE option to control page size for ODS destinations instead of LS and PS.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 635 views
  • 0 likes
  • 2 in conversation