| Date: | Mon, 4 May 2009 14:14:40 -0700 |
| Reply-To: | "Choate, Paul@DDS" <pchoate@DDS.CA.GOV> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Choate, Paul@DDS" <pchoate@DDS.CA.GOV> |
| Subject: | Re: Weird Character String |
|
| In-Reply-To: | A<200905041848.n44G3sts029838@malibu.cc.uga.edu> |
| Content-Type: | text/plain; charset="us-ascii" |
Mona -
To add a couple cents to the great answers you already have - what you
think are missing values are likely to be non-printing characters. You
may want to process non-writable characters out of your variable values
- I show two methods - the COMPRESS will remove them, the TRANSLATE will
replace them with blanks. I suggest the TRANSLATE because it will keep
the spacing of the original values. If you then want to reduce the
multiple spaces to single spaces the COMPBL function will work:
missingvar=COMPBL(missingvar)
data _null_;
missingvar='00'x;
/*looks like a "missing" but is really a ASCII null character*/
put missingvar=;
if missing(missingvar) then put 'Really Missing';
else put 'Not Really Missing';
/*missingvar=COMPRESS(missingvar,,'wk');*/
missingvar=TRANSLATE(missingvar,' ',compress(collate(0,,256),,'w'));
put missingvar=;
if missing(missingvar) then put 'Really Missing';
else put 'Not Really Missing';
run;
hope that's useful -
Paul Choate
DDS Data Extraction
(916) 654-2160
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Mona
Sent: Monday, May 04, 2009 11:49 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Weird Character String
Hi All,
I have a dataset where this one variable has a missing value for a lot
of
observations. The problem I having is when I use the missing function or
just a plain if to filter out records with missing value of that
variable,
nothing gets filtered. I do see a lot of them with missing values but
somehow it is not picking. Is there any function to resolve this ?
Any help appreciated.
|