LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (June 2009, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 29 Jun 2009 22:12:55 -0700
Reply-To:     naga <nagabiochem@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         naga <nagabiochem@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: how to generate diffrent titles for diffrent pages
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

On Jun 29, 7:52 pm, sethstja...@GMAIL.COM (Seth StJames) wrote: > Did you find what you want yet? > > 1 idea: > > options nobyline nodate number pageno=1; > > title1 "Subject Demographics - (By Gender)"; > title2 &sysdate &systime; > title4 " Gender: #byval(sex)"; > footnote; > proc report data=class nowd headline; > by sex; > columns name age sex, height, (N Mean); > define age/ group format=age.; > define sex/ across format=$sex. "_Gender_"; > define height/analysis ; > run; > > On Mon, Jun 29, 2009 at 10:10 AM, Richard A. DeVenezia < > > rdevene...@wildblue.net> wrote: > > On Jun 29, 8:46 am, naga <nagabioc...@gmail.com> wrote: > > > Hi sas experts > > > this is my data and i need to generate diffrent titles > > > like for males "THIS DATA BELONGS TO MALES" > > > Females "THIS DATA BELONGS TO FEMALES" > > > > proc format; > > > value age 11,12,13='Young age' > > > 14,15='Middle age' > > > 16,17='Old age'; > > > value $sex 'F'='Female' > > > 'M'='Male'; > > > run; > > > proc sort data=sashelp.class out=class; > > > by sex; > > > run; > > > proc report data=class nowd headline; > > > by sex; > > > columns name age sex,height,(N Mean); > > > define age/ group format=age.; > > > define sex/ across format=$sex. "_Gender_"; > > > define height/analysis ; > > > compute after ; > > > line ' '; > > > line ' ' ; > > > line 'This data Belongs to Gender'; > > > endcomp; > > > title ; > > > run; > > > Naga: > > > You might find the #BYVAR and #BYVAL specifiers useful. However, > > they only work withing TITLE and FOOTNOTE statements; > > footnote "#BYVAR1=#BYVAL1"; > > You might not want this in some destinations as the footnote appears > > outside the report 'box'; > > > Otherwise, you will need a second sex column. Why? Because you are > > using sex as a BY variable _and_ as an across variable. Across > > variable values are not available to the compute after section. > > > When you have a second column to work with you can track its value, > > and use the value in the compute after. > > > ---------------------------------------------- > > filename report TEMP; > > ods html file=report; > > > footnote "#BYVAR1=#BYVAL1"; > > > data class; > > set class; > > sex2=sex; > > run; > > > proc report data=class nowd headline; > > by sex; > > columns name sex2 age sex,height,(N Mean); > > define sex2 / display ; > > define age / order format=age. order=internal; > > define sex / across format=$sex. "_Gender_" ; > > define height / analysis ; > > > compute sex2; > > if not missing(sex2) and bygroup ne sex2 then > > byval1 = sex2; > > endcomp; > > > compute after ; > > line ' '; > > line ' ' ; > > line 'This data Belongs to ' byval1 $sex.; > > endcomp; > > title ; > > run; > > > ods html close; > > ---------------------------------------------- > > > Richard A. DeVenezia > >http://www.devenezia.com

Thanks


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