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;
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 Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.