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 (August 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 20 Aug 2008 20:52:48 -0500
Reply-To:     "./ ADD NAME=Data _null_," <iebupdte@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "./ ADD NAME=Data _null_," <iebupdte@GMAIL.COM>
Subject:      Re: format percent
Comments: To: Yi <eiwenchang@hotmail.com>
In-Reply-To:  <23d66939-bd27-4ae7-95d1-9481fc77c6e1@a3g2000prm.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1

I was close and you are close but we both omitted enough to make them wrong.

I think a better solution is make percent a proportion of 1 and use percentN format.

proc format; picture pctpic(round) low-<0 = ' 009.99%' (prefix='-') 0-high = ' 009.99%'; run;

data test; input y @@; x = y; z = round(y,0.01); p = y/1e2; cards; -0.4714 -3.9049 -1.5453 -0.6093 1.7270 -0.4368 6.9867 4.9193 -3.7195 4.5168 1.0350 -13.7587 -10.5845 -1.7963 -3.2401 -4.8683 run;

proc print; format y pctpic. p percentN8.2; var x y z p; run; On 8/20/08, Yi <eiwenchang@hotmail.com> wrote: > picture pctpic low-high='009.99%' (prefix='-') ; > > On Aug 20, 4:59 pm, iebup...@GMAIL.COM ("./ ADD NAME=Data _null_,") > wrote: > > picture pctpic(round) low-high='009.99%'; > > > > On 8/20/08, Marcelo Lamack <mar.lam...@hotmail.com> wrote: > > > > > > > > > Dear all, consider de following question: > > > > > proc format; > > > picture pctpic low-high='009.99%'; > > > run; > > > > > data test; > > > input y @@; > > > x = y; > > > z = round(y,0.01); > > > cards; > > > -0.4714 -3.9049 > > > -1.5453 -0.6093 > > > 1.7270 -0.4368 > > > 6.9867 4.9193 > > > -3.7195 4.5168 > > > 1.0350 -13.7587 > > > -10.5845 -1.7963 > > > -3.2401 -4.8683 > > > run; > > > > > proc print; > > > format y pctpic.; > > > var x y z; > > > run; > > > > > Obs x y z > > > > > 1 -0.4714 0.47% -0.47 > > > 2 -3.9049 3.90% -3.90 > > > 3 -1.5453 1.54% -1.55 > > > 4 -0.6093 0.60% -0.61 > > > 5 1.7270 1.72% 1.73 > > > 6 -0.4368 0.43% -0.44 > > > 7 6.9867 6.98% 6.99 > > > 8 4.9193 4.91% 4.92 > > > 9 -3.7195 3.71% -3.72 > > > 10 4.5168 4.51% 4.52 > > > 11 1.0350 1.03% 1.04 > > > 12 -13.7587 13.75% -13.76 > > > 13 -10.5845 10.58% -10.58 > > > 14 -1.7963 1.79% -1.80 > > > 15 -3.2401 3.24% -3.24 > > > 16 -4.8683 4.86% -4.87 > > > > > I woulk like to get the values equal to in the variable Z but with the percent sign. Where is the minus > > > sign in the variable y? > > > > > best regards > > > > > _________________________________________________________________ > > > Instale a Barra de Ferramentas com Desktop Search e ganhe EMOTICONS para o Messenger! É GRÁTIS! > > >http://www.msn.com.br/emoticonpack- Hide quoted text - > > > > - Show quoted text - >


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