|
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
|