Re: negative numbers

  • Follow


Jen,

Should all negative values be set to missing?  If so, then you
can use an array to loop over all of the numeric variables and
set any value which you find to be negative to missing.

Code which would do this is

data mydata;
  set mydata;
  array _numvarss_ {*} _numeric_;
  do i=1 to dim(_numvars_};
    if _numvars_{i}<0 then _numvars_{i}=.
  end;
run;


HTH,

Dale

---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: dmclerra@NO_SPAMfhcrc.org
Ph:  (206) 667-2926
Fax: (206) 667-5977
---------------------------------------


--- On Thu, 12/3/09, sweetums08 <duchon_jennifer@HOTMAIL.COM> wrote:

> From: sweetums08 <duchon_jennifer@HOTMAIL.COM>
> Subject: negative numbers
> To: SAS-L@LISTSERV.UGA.EDU
> Date: Thursday, December 3, 2009, 12:42 PM
> I am working with a public database,
> and want to convert repsonses
> that are coded as (-) (ex: -9 = did not respond) to "no" or
> "missing"
> data, so can run then that way.
> Help!
> Jen
>
0
Reply stringplayer_2 (1472) 12/3/2009 10:52:48 PM


0 Replies
281 Views

(page loaded in 0.095 seconds)

Similiar Articles:













7/30/2012 12:02:42 AM


Reply: