Hi
I've done some searching on this and can't find a solution I am not already trying. I have a standard proc report that is split using by variables. All has been good the bookmarks have been fine, but something has changed somewhere and I appear to be getting extra rows of data in the bookmark. In the PROC LABEL I put the table titles and then the BY splits. But for some reason now I am getting the variables that contribute to the table too.
The code that produces this is all macro driven, so I've extracted the actual report statement from the log - hopefully this makes sense, the ordering of the statements might be a little off.
ODS PDF FILE=outpdf style = styles.vx_pdf10 ;
ODS proclabel = "Table 28 Number (%) of subjects with adverse events during the 43-day (Days 0-42) post-vaccination period Total vaccinated cohort";
** Create the REPORT;
PROC REPORT DATA = _rep_list NOWD spanrows missing contents = "" split='|' style(report)={cellpadding=3px} ;
BY sexn racen;
COLUMN ODSDUMMY sexn racen asocnum sumvar GRP1_LAB, ( GRP1_NUM GRP1_PERC ) GRP_GAP GRP2_LAB, ( GRP2_NUM GRP2_PERC ) GRP_GAP GRPTOT_LAB, ( GRPTOT_NUM GRPTOT_PERC ) ;
;
DEFINE odsdummy / ORDER ORDER=DATA NOPRINT;
DEFINE asocnum / order order = DATA NOPRINT;
DEFINE sumvar / display order = DATA " " style(header)=[just=left ] style(column)=[cellwidth=48% ASIS=ON just=left ] spacing = 1 ;
DEFINE grp1_NUM / DISPLAY order = DATA "n or value" style(header)=[just=CENTER ] style(column)=[cellwidth=7.5% just=CENTER ] spacing = 1 ;
DEFINE grp1_PERC / DISPLAY order = DATA "%" style(header)=[just=CENTER ] style(column)=[cellwidth=7.5% just=CENTER ] spacing = 1 ;
DEFINE grp2_NUM / DISPLAY order = DATA "n or value" style(header)=[just=CENTER ] style(column)=[cellwidth=7.5% just=CENTER ] spacing = 1 ;
DEFINE grp2_PERC / DISPLAY order = DATA "%" style(header)=[just=CENTER ] style(column)=[cellwidth=7.5% just=CENTER ] spacing = 1 ;
DEFINE grpTOT_NUM / DISPLAY order = DATA "n or value" style(header)=[just=CENTER ] style(column)=[cellwidth=7.5% just=CENTER ] spacing = 1 ;
DEFINE grpTOT_PERC / DISPLAY order = DATA "%" style(header)=[just=CENTER ] style(column)=[cellwidth=7.5% just=CENTER ] spacing = 1 ;
DEFINE grp1_lab / ACROSS "" ORDER=INTERNAL;
DEFINE grp2_lab / ACROSS "" ORDER=INTERNAL;
DEFINE grpTOT_lab / ACROSS "" ORDER=INTERNAL;
DEFINE GRP_GAP / DISPLAY " " ORDER=INTERNAL style(column)=[cellwidth=1% ASIS=ON just=L ];
COMPUTE AFTER asocnum ;
LINE '';
ENDCOMP;
define sexn / NOPRINT GROUP CONTENTS="" PAGE FORMAT = sex. ;
define racen / NOPRINT GROUP CONTENTS="" PAGE FORMAT = race. ;
compute before _page_ / style={borderbottomstyle=solid borderbottomcolor=black fontweight=bold} ;
byvars = catx( ' ' , " Gender: " , PUT(sexn , sex.) ,' ' , " Nationality: " , PUT(racen , race.) ,' ' );
line @1 byvars $varying100.;
endcomp;
BREAK BEFORE odsdummy / CONTENTS="" PAGE;
RUN;
ODS PDF CLOSE;
As you can see I have use the BREAK and CONTENTS='' on "odsdummy" which is just a variable with the value of 1 to help with the Bookmarks.
Here is the output - its the yellow bookmark I want rid off.
I'm just curious where the variable names come from to be put into the bookmark
It's got to be something really simple I am missing.
Thanks for anyones help
🙂
It's ok I've found the solution
I just needed to remove PAGE & CONTENTS="" from the below DEFINE STATEMENTS:
define sexn / NOPRINT GROUP CONTENTS="" PAGE FORMAT = sex. ;
define racen / NOPRINT GROUP CONTENTS="" PAGE FORMAT = race. ;
If a moderator wants to delete this then please do so.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.