Iam looking for report like below ,
2nd page always should be signature page like below
By variable is Age
let's say i have 35,40,45 ages so it should be total 6 pages
3 pages of data and 3 pages of signature pages
but 2nd page should be always a signature page like below
|
Page No :1 |
|||
Title "Report Page1" by Age 35 |
||||
Name |
Age |
Sex |
||
Tom |
35 |
M |
||
Martin |
35 |
M |
||
Sophie |
35 |
F |
||
Page No : 2 |
||||
I here by confirm ---------Signature above report is correct |
||||
Page No : 3 |
||||
Title "Report Page1" by Age 40 |
||||
Name |
Age |
Sex |
||
Stephine |
40 |
M |
||
Don |
40 |
M |
||
Thomas |
40 |
M |
||
Page No : 4 |
||||
I here by confirm ---------Signature above report is correct |
Nope. Make a macro to generate the code I showed, not using BY statement.
proc sort data=sashelp.class out=output;by age;run;
proc freq data=output noprint;
table age/out=age;
run;
%macro report(age=);
proc report data=output nowd;
where age=&age.;
run;
ods pdf startpage=now;
proc odstext;
p 'Signature: ________________'/style={fontsize=8 just=r};
run;
%mend;
ods pdf file='c:\temp\temp.pdf' notoc;
options nodate nonumber;
title j=r ' PageNo:(*ESC*){thispage} ';
data _null_;
set age;
call execute(catt('%report(age=',age,')'));
run;
ods pdf close;
Maybe something like this with signature at the bottom of the page.
proc report data=sashelp.class;
columns age name sex height weight;
define age / order;
break after age / page;
compute after age / style(lines)=[just=r];
line ' ';
line 'Signature: ________________';
endcomp;
run;
i want completely in to the second page
Iam looking for report like below ,
2nd page always should be signature page like below
By variable is Age
let's say i have 35,40,45 ages so it should be total 6 pages
3 pages of data and 3 pages of signature pages
but 2nd page should be always a signature page like below
|
Page No :1 |
|||
Title "Report Page1" by Age 35 |
||||
Name |
Age |
Sex |
||
Tom |
35 |
M |
||
Martin |
35 |
M |
||
Sophie |
35 |
F |
||
Page No : 2 |
||||
I here by confirm ---------Signature above report is correct |
||||
Page No : 3 |
||||
Title "Report Page1" by Age 40 |
||||
Name |
Age |
Sex |
||
Stephine |
40 |
M |
||
Don |
40 |
M |
||
Thomas |
40 |
M |
||
Page No : 4 |
||||
I here by confirm ---------Signature above report is correct |
Like this?
options nodate nonumber; ods escapechar='^';
ods pdf file="~/test.pdf";
%macro report; %local i; %do i=11 %to 16; ods pdf startpage=now; title j=r 'Page ^{thispage} of ^{lastpage}' j=c "Report for age &i"; proc print noobs data=SASHELP.CLASS; where AGE=&i.; run; ods pdf startpage=now; title j=r 'Page ^{thispage} of ^{lastpage}' ; ods text="^S={just=c topmargin=5cm}I hereby confirm --------- the above report for age &i is correct."; ods text="^S={just=c rightmargin=2cm}Signature"; %end; ods _all_ close; %mend; %report
This creates page 1:
page 2:
etc
I merged your two topics dealing with the same question.
Use PROC ODSTEXT instead.
ods rtf file='c:\temp\temp.rtf' ;
options nodate nonumber;
title j=r ' PageNo:(*ESC*){thispage} ';
proc report data=sashelp.class nowd;
where age=14;
run;
ods rtf startpage=now;
proc odstext;
p 'Signature: ________________'/style={fontsize=8 just=r};
run;
ods rtf startpage=now;
proc report data=sashelp.class nowd;
where age=15;
run;
ods rtf startpage=now;
proc odstext;
p 'Signature: ________________'/style={fontsize=8 just=r};
run;
ods rtf startpage=now;
proc report data=sashelp.class nowd;
where age=16;
run;
ods rtf startpage=now;
proc odstext;
p 'Signature: ________________'/style={fontsize=8 just=r};
run;
ods rtf close;
Below is the updated code :
Iam getting signature page on only last page , but i need it for every by variable
proc sort data=sashelp.class out=output;by age;run;
ods pdf file='c:\temp\temp.pdf' ;
options nodate nonumber;
title j=r ' PageNo:(*ESC*){thispage} ';
proc report data=output nowd;by age;
ods pdf startpage=now;
proc odstext;
p 'Signature: ________________'/style={fontsize=8 just=r};
run;
ods pdf close;
Nope. Make a macro to generate the code I showed, not using BY statement.
proc sort data=sashelp.class out=output;by age;run;
proc freq data=output noprint;
table age/out=age;
run;
%macro report(age=);
proc report data=output nowd;
where age=&age.;
run;
ods pdf startpage=now;
proc odstext;
p 'Signature: ________________'/style={fontsize=8 just=r};
run;
%mend;
ods pdf file='c:\temp\temp.pdf' notoc;
options nodate nonumber;
title j=r ' PageNo:(*ESC*){thispage} ';
data _null_;
set age;
call execute(catt('%report(age=',age,')'));
run;
ods pdf close;
Thanks so much , it worked as i needed
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.