I want to print a statement at the top of each BYVAL table (or the top of each page) labelling the BYVAL. However, when an ODS PDF page break occurs in the middle of a table, the label should include the word "(continued)". I don't care if this happens through a line statement, ODS text, conditional label, some span functionality, etc. I don 't care if the proc report uses a BY statement or if I have to create a macro to run each BYVAL individually. I've only tried output ODS PDF, which needs to be the final result. But I guess if ODS PDF is causing the problem, I could use another ODS and save the result to pdf manually. I think I should be able to do this by evaluating _break_ type or observation number. I feel like I might need a hold value from one compute statement to use in another compute statement, but I can't get it right. Thank you in advance for any advice! proc sort data=sashelp.cars out=cars_make;
by make;
run;
ods escapechar='^';
options nobyline;
Title1 color='black' "^S={font_face='Verdana' font_size=18pt}Title1" ;
Title2 color='black' "^S={font_face='Verdana' font_size=18pt}Title2" ;
Title3 color='black' "^S={font_face='Verdana' font_size=18pt}Title3" ;
ods pdf file ="SGE26.pdf" notoc startpage=no ;
proc report data=cars_make (firstobs= 1 obs= 500) out=tryout;
where origin = 'USA';
by make;
column make DISP_make model type origin newobs;
define make /group noprint;
define DISP_make /computed;
define model / order order=internal;
define type / order order=internal;
define origin / order order=internal;
define newobs/display computed;
break after make/;
compute newobs;
_obs_+1;
newobs=(_obs_)-1;
endcomp;
compute before _page_ /left;
length text $100;
if hold_obs <2 then do;
text="For Bucket xxx";
num=100;
end;
else do;
text="For Bucket XXX (continued)";
num=150;
end;
line text $varying. num;
endcomp;
compute before make;
cnt_make + 1;
hold_make= make;
hold_obs=newobs;
endcomp;
compute DISP_make / character length= 20;
DISP_make = hold_make;
endcomp;
run;
ods pdf close;
... View more