Hi all!
I'm trying to compute a blank line between the table header and the first row for each page. I have three pages, I was only able to add the blank for the first page only, using compute before, compute before _page_.
I hope to get some magic wand to make this happen.
Thanks in anticipation.
Make a PAGE variable, and note the number of obs in each PAGE is less than the number of row in a real pdf page;
data have;
input strain $ day $ cyto $ age $;
datalines;
wuhan 1 CD107a 18
wuhan 1 IFN? 18
wuhan 1 TNFa 18
wuhan 1 L-12 18
wuhan 1 CD107a 40
wuhan 1 IFN? 40
wuhan 1 TNFa 40
wuhan 1 L-12 40
wuhan 64 CD107a 18
wuhan 64 IFN? 18
wuhan 64 TNFa 18
wuhan 64 L-12 18
wuhan 64 CD107a 40
wuhan 64 IFN? 40
wuhan 64 TNFa 40
wuhan 64 L-12 40
wuhan 120 CD107a 18
wuhan 120 IFN? 18
wuhan 120 TNFa 18
wuhan 120 L-12 18
wuhan 120 CD107a 40
wuhan 120 IFN? 40
wuhan 120 TNFa 40
wuhan 120 L-12 40
wuhan 360 CD107a 18
wuhan 360 IFN? 18
wuhan 360 TNFa 18
wuhan 360 L-12 18
wuhan 360 CD107a 40
wuhan 360 IFN? 40
wuhan 360 TNFa 40
wuhan 360 L-12 40
;
run;
data want;
set have;
if age= "18" then do;
agegrp = "18-39";
order=1;
end;
else if age = "40" then do;
agegrp = "40-60";
order=2;
end;
run;
data want;
set want;
output;
strain = "XE";
output;
run;
data want2;
set want(in=ina) want(in=inb) want(in=inc);
if ina then page=1;
if inb then page=2;
if inc then page=3;
run;
ods escapechar="^";
ods pdf file="practice2.pdf";
title;
proc report data=want2 spanrows nowd ps=170 split='^' missing contents=""
style(report)={cellpadding=3pt cellspacing=0pt just=c frame=above asis=on rules=groups}
style(header)={font=('times',6pt, normal) just=C asis=Off textalign=center background=white borderbottomwidth=2 bordertopwidth=2}
style(column)={font=('times',7pt, normal) cellwidth=8% asis=on cellheight=0.0005}
style(lines) ={font=('times',4pt, normal) asis=on};
column page strain day agegrp Cyto;
define page/order noprint;
define strain / style={just=c asis=on cellwidth=6% vjust=center} order flow;
define day / style={just=c asis=on cellwidth=7% vjust=center} "Day" order flow;
define agegrp / style={just=c asis=on cellwidth=9% vjust=center} "Age Group" order flow;
define Cyto / style={just=c asis=on cellwidth=7%} "Cytokine" display flow;
compute before page/style={background=navy}; /*Change it into WHITE*/
line " ";
endcomp;
break after page/page;
run;
ods pdf close;
@Cynthia_sas I created a new variable to break the page and so computed a blank line the same variable.
Thanks for your help.
Yet another incomplete description of what you "want".
What variable in your data set is controlling where the PAGE breaks? If YOU do not control the page break there is almost no chance that code will in any consistent manner.
Make a PAGE variable, and note the number of obs in each PAGE is less than the number of row in a real pdf page;
data have;
input strain $ day $ cyto $ age $;
datalines;
wuhan 1 CD107a 18
wuhan 1 IFN? 18
wuhan 1 TNFa 18
wuhan 1 L-12 18
wuhan 1 CD107a 40
wuhan 1 IFN? 40
wuhan 1 TNFa 40
wuhan 1 L-12 40
wuhan 64 CD107a 18
wuhan 64 IFN? 18
wuhan 64 TNFa 18
wuhan 64 L-12 18
wuhan 64 CD107a 40
wuhan 64 IFN? 40
wuhan 64 TNFa 40
wuhan 64 L-12 40
wuhan 120 CD107a 18
wuhan 120 IFN? 18
wuhan 120 TNFa 18
wuhan 120 L-12 18
wuhan 120 CD107a 40
wuhan 120 IFN? 40
wuhan 120 TNFa 40
wuhan 120 L-12 40
wuhan 360 CD107a 18
wuhan 360 IFN? 18
wuhan 360 TNFa 18
wuhan 360 L-12 18
wuhan 360 CD107a 40
wuhan 360 IFN? 40
wuhan 360 TNFa 40
wuhan 360 L-12 40
;
run;
data want;
set have;
if age= "18" then do;
agegrp = "18-39";
order=1;
end;
else if age = "40" then do;
agegrp = "40-60";
order=2;
end;
run;
data want;
set want;
output;
strain = "XE";
output;
run;
data want2;
set want(in=ina) want(in=inb) want(in=inc);
if ina then page=1;
if inb then page=2;
if inc then page=3;
run;
ods escapechar="^";
ods pdf file="practice2.pdf";
title;
proc report data=want2 spanrows nowd ps=170 split='^' missing contents=""
style(report)={cellpadding=3pt cellspacing=0pt just=c frame=above asis=on rules=groups}
style(header)={font=('times',6pt, normal) just=C asis=Off textalign=center background=white borderbottomwidth=2 bordertopwidth=2}
style(column)={font=('times',7pt, normal) cellwidth=8% asis=on cellheight=0.0005}
style(lines) ={font=('times',4pt, normal) asis=on};
column page strain day agegrp Cyto;
define page/order noprint;
define strain / style={just=c asis=on cellwidth=6% vjust=center} order flow;
define day / style={just=c asis=on cellwidth=7% vjust=center} "Day" order flow;
define agegrp / style={just=c asis=on cellwidth=9% vjust=center} "Age Group" order flow;
define Cyto / style={just=c asis=on cellwidth=7%} "Cytokine" display flow;
compute before page/style={background=navy}; /*Change it into WHITE*/
line " ";
endcomp;
break after page/page;
run;
ods pdf close;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.