The SAS Output Delivery System and reporting techniques

Column headings appearing at bottom of table

Reply
New Contributor
Posts: 4

Column headings appearing at bottom of table

Hello,

I am trying to create a pdf using ODS and PROC REPORT. In this report, there are three tables, and the formatting turns out fine with the first two tables, but not the third. In the third table, the table headings are appearing at the bottom, rather than the top of the table.

Below is the code I am using for that third table:

ods pdf startpage=NOW;

ods pdf text = "^S={just=l font_size=2 font_weight=medium font_style=roman}The following table summarizes ..." ;

proc report data=readme_elig_summary

missing nowd split='\' SPANROWS;

column

  order_ind_1

  bos_desc

  order_ind_2

  spon_cat

  bene_cnt

  spon_cnt

  pd_amt

  ('Referred for Case Development' spon_75k_cnt pd_amt_75k);

define order_ind_1 / order noprint;

define bos_desc / group "Sponsor Branch\of Service" style(column)={just=l font_weight=medium font_style=roman font_size=1 cellwidth=1.2in} style(header)={just=c verticalalign=c};

define order_ind_2 / order noprint;

define spon_cat / group "Sponsor\Category" style(column)={just=l font_weight=medium font_style=roman font_size=1 cellwidth=0.8in} style(header)={just=c verticalalign=c};

define bene_cnt / group "Number of\Patients" style(column)={just=r font_weight=medium font_style=roman font_size=1 cellwidth=.7in} style(header)={just=c verticalalign=c};

define spon_cnt / group "Number of\Sponsors" style(column)={just=r font_weight=medium font_style=roman font_size=1 cellwidth=.7in} style(header)={just=c verticalalign=c};

define pd_amt / group "Paid\Amount" style(column)={just=r font_weight=medium font_style=roman font_size=1 cellwidth=.8in} style(header)={just=c verticalalign=c};

define spon_75k_cnt / group "Number of\Sponsors" style(column)={just=l textalign=d textindent=50 font_weight=medium font_style=roman font_size=.8 cellwidth=.7in} style(header)={just=c verticalalign=c bordertopcolor=black} ;

define pd_amt_75k / group "Paid\Amount" style(column)={just=r font_weight=medium font_style=roman font_size=1 cellwidth=1in} style(header)={just=c verticalalign=c bordertopcolor=black} ;

  compute bos_desc;

  if bos_desc = '    GRAND TOTAL'

  then call define(_row_, "style", "style={bordertopcolor=black font_weight=bold}");

  endcomp;

  compute spon_cat;

  if spon_cat = '  Total'

  then call define(_row_, "style", "style={font_weight=bold}");

  endcomp;

run;

options bottommargin=0in;

Any assistance is appreciated!

Thanks

SAS Super FREQ
Posts: 8,743

Re: Column headings appearing at bottom of table

Hi:

  I don't see how your code is producing3 tables. I don't see a BY statement and I don't see the PAGE option. So it looks like you might be getting 1 table that spans 3 pages??? Without any access to your data in order to run the code and without seeing ALL your statements, including your ODS PDF statements it is hard to make a constructive suggestion. Also, the version of SAS you're using might make a difference, since there have been some fairly extensive enhancements to PDF between SAS 9.1.3 and 9.2 and again in 9.3.

  Since this issue you have seems to me to be very dependent on your data my recommendation is that you open a track with Tech Support, where they can look at ALL of your code and run the program with a sample of your actual data and replicate your version of SAS to make sure they get the same results that you see with the headers at the bottom of the page.

cynthia

New Contributor
Posts: 4

Re: Column headings appearing at bottom of table

Hi Cynthia,

My apologies, I only included the code for the table that was not rendering correctly. Unfortunately, I cannot share the data, because it contains PHI. I do know that the original code was written in SAS 9.3 by the person before me and I have since been upgraded to SAS 9.4. I have attached the code in its entirety.

I do know that there was a recent patch for Adobe that has caused issues with being able to read other pdfs - assuming there is no issue with the code, would a faulty patch contribute to issues with ODS formatting?

Thanks for any help!

Elizabeth

Attachment
SAS Super FREQ
Posts: 8,743

Re: Column headings appearing at bottom of table

HI, Elizabeth:

  Without data, it is impossible to debug what is going on. If you need confidentiality, then you can work with Tech Support or you make up a "test case" where you copy ONLY the data that is going to the PROC REPORT and change all the names to XXXX with a random number assigned. Tech Support can maintain the confidentiality of your data and your program to help you figure this out. I see from your code that you have a LOT of ODS PDF TEXT= statements and you also have a LOT of data manipulation steps with PROC SQL. So basically, Tech Support doesn't need to see any of the SQL, they would only need to see the macro and datasets that went into the PROC REPORT step.

  cynthia

New Contributor
Posts: 4

Re: Column headings appearing at bottom of table

Unfortunately, this is DOD data and, even de-identified, I can't send it outside of the organization. Thanks for trying, anyway.

Super User
Posts: 10,500

Re: Column headings appearing at bottom of table

Make a dataset with completely dummy data, variables with names like Class1 class2 var1 var2 or similar with the same data type as your problem set that will duplicate the behavior. Then modify the code to use that dummy set. It might not hurt to remove all of the style stuff as well. If you can't duplicate the behavior with other data then there is something in the data itself.

New Contributor
Posts: 4

Re: Column headings appearing at bottom of table

Thanks, I tested with other data and it's not the data. Working with SAS Tech Support - may be a printer set up issue.

Ask a Question
Discussion stats
  • 6 replies
  • 741 views
  • 3 likes
  • 3 in conversation