The SAS Output Delivery System and reporting techniques

re: ODS PDF

Reply
Regular Contributor
Posts: 221

re: ODS PDF

Hi...I am trying to insert the number and name inside the header using the byval() and it doesn't seem to work. Can this be done and used with the Column statement? Thanks.

 

ODS PDF FILE="%sysfunc(pathname(project))\&FILENAME Report (&rundate).PDF" STYLE=JOURNAL NOTOC BOOKMARKGEN=NO BOOKMARKLIST=NONE STARTPAGE=NOW;

OPTIONS NOQUOTELENMAX;

PROC REPORT DATA=FINALDATASET NOWD HEADLINE HEADSKIP MISSING ps=43 ls=108
  style(report)={frame=box just=CENTER}
 STYLE(header)={font_weight=bold background=lightgrey font_face=Arial 
  font_size=8pt borderwidth=1px bordercolor=black just=CENTER}
 STYLE(COLUMN)={background=white font_face=Arial font_size=7pt borderwidth=1px
  bordercolor=black just=CENTER}
 STYLE(LINES)={JUST=C FONT_WEIGHT=BOLD FONT_SIZE=11PT};
 WHERE CH_Number ="&CH_Number"
 AND CH_Name ="&CH_Name";
BY CH_Number CH_Name;

COLUMN ("CH Number: #BYVAL(CH_Number) CH Name: #BYVAL(CH_Name)" LEVEL TOTAL_COST NUMBER_PURCHASES);
BY CH_Number CH_Name NOTSORTED;
 DEFINE LEVEL / DISPLAY 'LEVEL' STYLE(COLUMN)={JUST=LEFT};
 DEFINE TOTAL_COST / DISPLAY 'TOTAL COST' FORMAT=DOLLARr12.2 STYLE(COLUMN)={TAGATTR='format:$#,##0.00' JUST=RIGHT};
 DEFINE NUMBER_PURCHASES / DISPLAY 'NUMBER PURCHASES' STYLE(COLUMN)={TAGATTR='format:#,##' JUST=RIGHT};
RUN;

Grand Advisor
Posts: 9,315

Re: re: ODS PDF

Can you post a Screen Snap and a sample data to explain your question?

If you want use #byval ,firstly you need specify :

options nobyline;

And also you could try :

#BYVAL1

#BYVAL2

SAS Super FREQ
Posts: 8,642

Re: re: ODS PDF

Hi: #BYLINE/BYVAL/#BYVAR will ONLY work in a TITLE statement. I see that you are trying to use them in a COLUMN statement. That will not work. Did you read the documentation on the use of #BYVAL???

You already have Macro variables for &CH_Number and &CH_Name.

KSharp is correct that to use the special BY variable tokens in a TITLE statement you usually need the NOBYLINE option -- but you do not have a TITLE statement.

Some of your options don't make sense, either for ODS PDF.. PROC REPORT options like HEADLINE, HEADSKIP, PS and LS are LISTING only options and are ignored by ODS PDF (and all the other ODS destinations).

cynthia
Post a Question
Discussion Stats
  • 2 replies
  • 281 views
  • 0 likes
  • 3 in conversation