From: sweetums08 on
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
From: Dale McLerran on
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(a)NO_SPAMfhcrc.org
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------


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

> From: sweetums08 <duchon_jennifer(a)HOTMAIL.COM>
> Subject: negative numbers
> To: SAS-L(a)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
>