I see you have already posted here two weeks ago, with less details, I must have overlooked, my bad. So condsider the following:
proc sort data=sashelp.class(drop=height) out=no_height;
by name;
run;
proc sort data=sashelp.class(drop=weight) out=no_weight;
by name;
run;
proc sort data=sashelp.class(drop=age) out=no_age;
by name;
run;
data final;
set no: indsname=dsname;
by name;
source=dsname;
if _n_>6 then
stop;
run;
data _null_;
set final end=last;
by name;
if first.name then
call execute('ods pdf file='||'"h:\temp\name_'||strip(name)||'.pdf";' );
call execute('ods pdf startpage=now;
proc print data=final(firstobs='||_n_||' obs='||_n_||');
run;'
);
if last then
call execute('ods pdf close;');
run;
Please note, since your request evolved, so I opted to choose a different merge strategy, rather, it is more like a sorted 'stacking', in order to show the 'source' of your obs.
... View more