12-09-2015 10:52 AM
I have used that option and i am looking for alternate also where i can use some macro variables and populate the subject id in the header part/title of page.
12-09-2015 01:40 PM
I used below but not working as per my requirement.
input x $ score ;
create table aa as select distinct x from a;
select distinct x into :n_1-:n_&sqlobs from a;
%let N = &sqlobs;
%do i=1 %to &N;
create table report as select score from a where x="&&n_&i";
title "report for &&n_&i";
ODS PDF FILE="D:\Practice\test.pdf";
proc report data=re nowd;
column sn score;
define sn /order ;
ods _all_ close;
So ideally this should print two pages in output but it print only single page and that is for last subject only.
I have observed that macro is overwriting the observations.Please guide.
12-10-2015 10:58 AM
12-10-2015 11:22 AM
In your macro, the statement
ODS PDF FILE="D:\Practice\test.pdf"
recreates test.pdf every time the macro is called. That means each time you call the macro the macro overwrites the previous version of the file. Remove this statement from your macro and put it just before you run the macro.
12-10-2015 11:50 AM