BookmarkSubscribeRSS Feed
HitmonTran
Pyrite | Level 9

Hi, 

Not sure what my define statement is doing to cause a gap on the header and footer in pdf output (RTF looks good).

 

HitmonTran_1-1611341044072.png

 

code:

ods pdf file = " &pgmname..pdf" startpage=no style= TLF_CN_9;
option formchar="|----|+|---+=|-/\<>*" ls=70 ps=70 missing = " " nobyline nocenter nodate nonumber orientation=landscape;
proc report data=final nowindows center headline headskip missing split='|'; column ord1 ord2 desc &alltrt all; define ord1 / order order=internal noprint; define ord2 / order order=internal noprint; define desc / display " " style(header)=[just=left] style(column)=[asis=on cellwidth=2.5 in ] ; run;

if i use "left" my indentations are gone.

3 REPLIES 3
ballardw
Super User

Without your style and your data there really isn't any way to check what may be happening.

 

I would start by reviewing the definition of your TLF_CN_9 style.

 

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 </> icon or attached as text to show exactly what you have and that we can test code against.

Ksharp
Super User
ods rtf file="c:\temp\x.rtf" style=journal;
proc report data=sashelp.class nowd;
column name age dummy weight height;
define dummy/computed '   ' style(header column)={ bordertopcolor=white bordertopwidth=2
                                    borderbottomcolor=white borderbottomwidth=2 cellwidth=100};
compute dummy/character length=40;
dummy='    ';
endcomp;
run;
ods rtf close;

屏幕截图 2021-01-23 195009.png

Cynthia_sas
Diamond | Level 26

Hi:

  As already indicated by others, without knowing your style and your macro variable values and having some test data, it is nearly impossible to make a constructive suggestion.

 

  However, there are some things that you could fix that are just distractors and may or may not impact the output:

1) OPTIONS:  You should NOT need the FORMCHAR option, that is a LISTING only option. Also, LS= and PS= are ignored by ODS PDF and actually inconsistent with your orientation=landscape. And, my understanding was that you should specify your OPTIONS before you open the ODS PDF destination, so I would absolutely change your OPTIONS statement so it was before the ODS PDF statement.

2) PROC REPORT statement: HEADLINE and HEADSKIP are LISTING only options and ignored by ODS destinations like PDF. So I would recommend that you get rid of these options, they are doing nothing.

3) DEFINE for DESC column: there are other ways to make a line indent other than using ASIS=ON. ODS PDF supports the LEFTMARGIN= option as shown below:

leftmargin_pdf.png

Hope this helps.

Cynthia

 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1962 views
  • 0 likes
  • 4 in conversation