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 (July 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 12 Jul 2006 04:36:49 -0400
Reply-To:     Scott Bass <sas_l_739@YAHOO.COM.AU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Scott Bass <sas_l_739@YAHOO.COM.AU>
Subject:      Re: PROC REPORT - insert page in the middle

Hi Jim,

Any details on how you would approach the sample program to print a page 2, consisting of line statements, between pages 1 and 3?

Cheers, Scott

P.S.: Don't go being like Joker Joe...all hints, no details :-) ;-) :-D

P.S.S.: We could add new lexicon to the SAS-L community...I once heard the term "You got Monica'd" for, well, you can guess.

So, we can coin the term, "Don't Joe me" to mean "All bluster, no substance".

On Wed, 12 Jul 2006 02:50:40 -0400, Jim Groeneveld <jim2stat@YAHOO.CO.UK> wrote:

>Hi Mike / Scott, > >That is where I use macro code for. LINE statements can easily be made >macro-conditionally dependent. I calculate the whole layout (formats, >widths, positions, titles, labels, spacing, borders) of a PROC REPORT (in >several of my macros -under development-) in macro variable values. That >is what Scott might consider too, but he has to redesign it all completely. > >Regards - Jim. >-- >Jim Groeneveld, Netherlands >statistician, SAS consultant >home.hccnet.nl/jim.groeneveld > >On Tue, 11 Jul 2006 17:42:22 -0400, Mike Rhoads <RHOADSM1@WESTAT.COM> >wrote: > >>Scott, >> >>Well, actually, this is not a simple problem at all. The answer to your >>#2 is simple, but almost certainly not what you want to hear. >> >>There is a design quirk in PROC REPORT that is a major snare for the >>unwary. To make a long and sad story short, LINE statements cannot be >>executed conditionally, even if your code makes it look like they would. >>They are executed whenever the block executes. From the 9.1.3 online >>doc: >> >>"You cannot use the LINE statement in conditional statements (IF-THEN, >>IF-THEN/ELSE, and SELECT) because it is not executed until PROC REPORT >>has executed all other statements in the compute block." >> >>Typically the way to work around this is to create a new variable in the >>COMPUTE block, conditionally assign values to it (blank if you don't >>really want anything), and then reference that variable in your >>unconditional LINE statement. Whether you could use this technique to >>insert a whole page's worth of stuff into a PDF doc is beyond my >>technical capabilities. >> >>An excellent alternate source for help on this would be the ODS and Base >>Reporting User Forum on the SAS web site -- see >>http://support.sas.com/forums/index.jspa?categoryID=1. If you don't get >>anything useful either there or on SAS-L, it probably can't be done. >> >>Good luck! >> >>Mike Rhoads >>Westat >>RhoadsM1@Westat.com >> >>-----Original Message----- >>From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu] >>On Behalf Of Scott Bass >>Sent: Tuesday, July 11, 2006 5:11 AM >>To: SAS-L@LISTSERV.UGA.EDU >>Subject: PROC REPORT - insert page in the middle >> >> >>Hi, >> >>Sorry for the simple question, but I just can't find this in the doc :-( >> >>Test code: >> >>data one; >> do x=1 to 30; >> select; >> when( 0 <= x <= 10) pagevar=1; >> when(11 <= x <= 20) pagevar=2; >> otherwise pagevar=3; >> end; >> output; >> end; >>run; >> >>proc report data=one nowd; >> columns pagevar x; >> define pagevar / order; >> define x / display; >> >> break after pagevar / page; >> >> compute after pagevar; >> if pagevar = 5 then do; >> line @1 "foo"; >> line @1 " "; >> line @1 "bar"; >> line @1 " "; >> end; >> endcomp; >>quit; >> >>1. What I really want to do is 1) print page 1, 2) print a page 2 using >>line statements, then do a page eject, 3) then print pages 3 and 4 (page >>values 2 & 3 respectively). >> >>2. I don't get why the IF is ignored in the above code; foo bar gets >>printed on each page. >> >>The final output should be: >> >> pagevar x >> 1 1 >> 2 >> 3 >> 4 >> 5 >> 6 >> 7 >> 8 >> 9 >> 10 >><page break> >>foo >> >>bar >><page break> >> pagevar x >> 2 11 >> 12 >> 13 >> 14 >> 15 >> 16 >> 17 >> 18 >> 19 >> 20 >><page break> >> pagevar x >> 3 21 >> 22 >> 23 >> 24 >> 25 >> 26 >> 27 >> 28 >> 29 >> 30 >> >>I'd prefer using PROC REPORT vs. DATA _NULL_ because it's easier to add >>the >>style code (final output is PDF). But, the end user really wants this >>intermediate page in the middle rather than the end (It's just some >>text, >>blank lines for writing comments under the text, and signature lines. >>Pages 2 & 3 are appendices to Page 1 plus the signature page). >> >>Thanks, >>Scott


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