LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 26 May 2006 12:12:21 -0400
Reply-To:     Talbot Michael Katz <topkatz@MSN.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Talbot Michael Katz <topkatz@MSN.COM>
Subject:      PROC SQL Sum Into Macro Variable

Hi.

Please have patience with me. I think I asked a question like this before, but somehow I still haven't gotten it.

When I sum into macro variable as follows:

proc sql ; reset noprint ; select sum(x * (x ge &lim.)) into :sum_x_above_lim from ds1 ; quit ;

310 %put sum_x_above_lim = 310! %sysfunc(putn(&sum_x_above_lim.,comma15.2)) ; sum_x_above_lim = 16,610,879.00

316 %put sum_x_above_lim = &sum_x_above_lim. ; sum_x_above_lim = 16610879

When I sum the same into a data set:

proc sql ; create table sum_x_above_lim as select sum(x * (x ge &lim.)) as sum_x_above_lim from ds1 ; quit ;

and I print out the value I get: 16610879.18

Why am I losing the part after the decimal point in the macro variable?

-- TMK -- "The Macro Klutz"


Back to: Top of message | Previous page | Main SAS-L page