LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 18 Apr 2002 09:01:26 +0200
Reply-To:   Andreas Grueninger <grueninger@IBGRUENINGER.DE>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Andreas Grueninger <grueninger@IBGRUENINGER.DE>
Organization:   T-Online
Subject:   Re: Pagination in proc print
Content-Type:   text/plain; charset=ISO-8859-1

AFAIK there is no way. You may use a macro like the following

%MACRO m; %LOCAL items word i; PROC SQL NOPRINT; SELECT DISTINCT location INTO :items SEPARATED BY ' ' FROM stuff; QUIT; %IF ("&items" EQ "") %THEN %DO; DATA; text = 'No locations found!'; RUN; TITLE 'Problem!'; PROC PRINT NOOBS; RUN; TITLE; %END; %ELSE %DO; %DO i=1 %TO 10000; %LET word=%SCAN( &items,&i ); %IF ("&word" NE "") %THEN %DO; TITLE "Location is &word"; options pageno=1; proc print data=stuff; by location; WHERE (location=&word); run; TITLE; %END; %ELSE %LET i=10000; %END; %END; %MEND; OPTIONS NODATE NOBYLINE; DATA stuff; DO location=1 TO 10; DO a=1 TO 100; OUTPUT; END; END; RUN; ODS PDF FILE='C:\test\test.pdf'; %m; * --- and now a test for an empty data set ; data stuff; stop; run; %m; ODS PDF CLOSE;

"Patrick F. O'Neill" <Patrick.F.O'Neill@KP.ORG> schrieb im Newsbeitrag news:OF82726070.F3848235-ON88256B9E.007DD95E@crdc.kp.org... > Dear SAS-L, > > Is there a way to reset pagination (to page 1) within a single Proc PRINT > according to the values of the PAGEBY variable? > > I would like something like this to work: > > proc print data=stuff; > by location; > pageby location; > if first.location then options pageno=1; > run; > > Of course, this is hopeless, since I have a data step "if" and an OPTIONS > statement in a PROC. > > Can I achieve this without breaking up the dataset into small datasets (by > location) and then printing each one? > > Thanks, > Pat


Back to: Top of message | Previous page | Main SAS-L page