Date: Mon, 7 May 2007 12:48:00 -0400
Reply-To: Nirmal kumar <lazybone2k@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Nirmal kumar <lazybone2k@GMAIL.COM>
Subject: Re: numeric format
In-Reply-To: <200705071628.l47An06M017744@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Huang,
Thanks for the suggestion. It worked fine.
I tried to apply the commaw.d format. It didnt work. I am not sure now.
Try the following program....
*******************************************
*
data* _null_;
a = *123456789123456* ;
call symput ('a1',put(a,*15.2*));
*
run*;
*
data* _null_;
b = "&a1";
c= input(b,*15.*);
put " value of a1 &a1 ";
put " value of b " b;
put "value of c " c comma15.;
*format c comma15.;
*
run*;
*******************stil the commaw.d doesnt work.....*
**
*Thanks,*
*Kumar*
On 5/7/07, Ya Huang <ya.huang@amylin.com> wrote:
>
> change it to:
>
> call symput ('a1', put(a,15.2));
>
> For call symput, the second aurgument is expected to be a character.
> If you put a numerica var there, SAS will convert it automatically
> but with default format which may not be long enough for you.
>
> 5
> 6 data _null_;
> 7 b = input("&a1",15.);
> 8 put " value of a1 &a1 ";
> 9 put " value of b " b;
> 10 format b 15.2;
> 11 run;
>
> value of a1 123456789123456
> value of b 123456789123456
>
>
> On Mon, 7 May 2007 11:47:24 -0400, Nirmal kumar <lazybone2k@GMAIL.COM>
> wrote:
>
> >Dear listers,
> >
> >Please help me....I am trying to aggregate the current balance of the
> some
> >900,000 accounts. the ammount comes in billiions. I am not able to print
> it
> >to the external file.
> >
> >The sql procedure is used to sum the current balances and the resulting
> >value is stored in a macro variable. I am trying to write the value of
> the
> >macro variable to an external file. well it is writing properly, but the
> >format for the number is different.
> >
> >In the following program the value of a1 and b is written as
> >
> >value of a1 1.2345679E14
> >
> >value of b 123456790000000
> >But i want it to be *
> >
> >123456789123456 or 123,456,789,123,456.
> >
> >**********************program*****************
> >
> >data _null_;
> >
> >a = 123456789123456 ;
> >
> >call symput ('a1', a);
> >
> >run;
> >
> >data _null_;
> >
> >b = input("&a1",15.);
> >
> >put " value of a1 &a1 ";
> >
> >put " value of b " b;
> >
> >format b 15.2;
> >
> >run;
> >
> >*************************************************
> >
> >
> >
> >please help me......
> >
> >
> >
> >
> >
> >Thanks,
> >
> >Kumar
> >*
>
|