Date: Wed, 27 Jan 2010 21:54:28 +0100
Reply-To: Daniel Fernández <fdezdan@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Daniel Fernández <fdezdan@GMAIL.COM>
Subject: Re: Decimal Number
In-Reply-To: <006401ca9f86$70900080$51b00180$@com.br>
Content-Type: text/plain; charset=ISO-8859-1
data sdf;
input a b;
cards;
2 3.56
3 4.56
4 5.89
5 6.36
;
run;
data need;
set sdf (rename=b=_b);
b=cats('.',scan(_b,2,'.'));
drop _b;
run;
OUTPUT:
a b
2 .56
3 .56
4 .89
5 .36
Daniel Fernandez.
Barcelona.
2010/1/27 Adriano Rodrigues <adriano@gpp.com.br>:
> Make x100
>
> -----Mensagem original-----
> De: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] Em nome de room
> Enviada em: quarta-feira, 27 de janeiro de 2010 10:18
> Para: SAS-L@LISTSERV.UGA.EDU
> Assunto: Re: Decimal Number
>
> On Jan 27, 2:20 pm, TheSharpOne <sharp...@hotmail.co.uk> wrote:
>> On 27 Jan, 07:06, room <porus....@gmail.com> wrote:
>>
>>
>>
>>
>>
>> > Hi SAS users,
>>
>> > I am having small doubt.I will write the dataset.
>>
>> > data sdf;
>> > input a b;
>> > cards;
>> > 2 3.56
>> > 3 4.56
>> > 4 5.89
>> > 5 6.36
>> > run;
>> > proc print ;
>> > run;
>>
>> > i want output like this
>>
>> > a b
>> > 2 .56
>> > 3 .56
>> > 4 .89
>> > 5 .36
>>
>> > pls send me the solution as early as poosible.
>>
>> add this additional step
>> Data want;
>> Set sdf;
>> b = b-Int(b);
>> Run;
>
> Fro the above code iam getting output like this:
> 0.56
> 0.56
> 0.89
> 0.36
>
> But i want output exactly like this
> 56
> 56
> 89
> 36
>
>
> Regards,
> Porus.
>
|