Date: Mon, 7 May 2007 16:59:17 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: numeric format
In-Reply-To: <601d11620705070948q68cce4a7gfefb79348041cf2f@mail.gmail.com>
Content-Type: text/plain; format=flowed
Your making your life way too hard, format statement doesnt affect the way
the put statement will print the numbers:
data _null_;
a = 123456789123456 ;
call symputX ('a1',a );
run ;
data _null_;
b = &a1 ;
put " value of a1 &a1 ";
put " value of b " b ;
put "value of b " b comma20.;
run ;
Toby Dunn
You can see a lot by just looking. ~Yogi Berra
Do not seek to follow in the footsteps of the wise. Seek what they sought.
~Matsuo Basho
You never know what is enough, until you know what is more than enough.
~William Blake, Proverbs of Hell
From: Nirmal kumar <lazybone2k@GMAIL.COM>
Reply-To: Nirmal kumar <lazybone2k@GMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: numeric format
Date: Mon, 7 May 2007 12:48:00 -0400
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
> >*
>
_________________________________________________________________
Get a FREE Web site, company branded e-mail and more from Microsoft Office
Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/