|
One quick and dirty solution I could think of -
data test;
set xxxtest;
z = put(t,best23.);
if indexc(z,'.') > 0 then z2 = length(left(scan(z,2,'.')));
else z2 = 0;
run;
proc sql;
select max(z2) into :maxdec
from test;
quit;
On 10/24/07, Raj <ramesh.chakri@gmail.com> wrote:
> HI,
>
> Say there is a dataset like below, how to find the maximum num of
> decimal places that variable T has in this dataset and store it into a
> macro variable
>
> In this case the maximum decimals is 2. Any solutions team..?
>
> data xxxtest;
> input t ;
> datalines;
> 1
> 2.2
> 3.33
> 2.0
> 4
> ;
> run;
>
|