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 (March 2007, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 2 Mar 2007 12:27:36 -0500
Reply-To:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:   Re: Formating with Put function

Percent makes that like you said. Something like:

proc format; picture pct low-<0 = "0009.99%" (mult=10000 prefix="-") 0-high = "0009.99%" (mult=10000 prefix=" "); run;

data xxy; input draw abc ; datalines; 2 56.2 3 -79.09 4 88.90 5 -90.00 ; run;

data xxy1; set xxy; ax=left(trim(put(abc, 8.2))); bx=left(trim(put(abc/100,pct.))); cx=put(abc/100,pct.); run;

proc print;run;

could make it. If you need also rounding instead of cutting off, you can use the round option in the picture statement or add a small 0.0...45 (count the 0's) before cutting off which forces the rounding also. Hope that shows you the way. Gerhard

On Fri, 2 Mar 2007 12:00:48 -0500, mesecca L katram <mesecca@YAHOO.COM> wrote:

>Hi all >I am trying to format my report, here I am quoting the example so every >body can run > >data xxy; >input draw abc ; >datalines; >2 56.2 >3 -79.09 >4 88.90 >5 -90.00 >; >run; > >data xxy1; >set xxy; >abc=left(trim(put(sdc, 8.2))); >bbc=left(trim(put(sdc/100,percent8.2))); >run; > >once you run it the results looks >draw abc bbc >2 56.2 56.20% >3 -79.09 (79.09%) >4 88.9 88.90% >5 -90 (90.00%) > >some how puct function is putting bracket for negative value >how do I make it look as follows.... > > >but I need them >draw abc bbc >2 56.2 56.20% >3 -79.09 -79.09% >4 88.9 88.90% >5 -90 -90.00% > > >thanks


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