Date: Fri, 16 Mar 2001 14:00:30 -0500
Reply-To: "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Subject: Re: Character Values in a Numerical Column
Content-Type: text/plain; charset="iso-8859-1"
A quick follow up to my last message. I ran the same test again, but this
time with a proc print. Even though the log says that it will not accept the
general dot (.) as a special missing value it shows up on the print and also
in a FS View (see OBS 28 onwards in the proc print below). Maybe the key
word is "special missing" and the system assigns the general missing to any
that does not fall into the special missing category.
Anyone with a good explanation?
Regards,
Venky
385 data w (drop=i);
386 missing a b c d e f g h i j k l m n o p q r s t u v w x y z _ .;
-
36
387 length alpha $41 miss 8;
388 alpha='abcdefghijklmnopqrstuvwxyz_.~!@#$%&*()+-=';
389 do i=1 to 41;
390 miss=substr(alpha,i,1);
391 output;
392 end;
393 run;
ERROR 36-169: . is an invalid special missing value. Only letters A through
Z and _ can be used.
NOTE: Character values have been converted to numeric values at the places
given by: (Line):(Column).
390:10
NOTE: Invalid numeric data, '~' , at line 390 column 10.
NOTE: Invalid numeric data, '!' , at line 390 column 10.
NOTE: Invalid numeric data, '@' , at line 390 column 10.
NOTE: Invalid numeric data, '#' , at line 390 column 10.
NOTE: Invalid numeric data, '$' , at line 390 column 10.
NOTE: Invalid numeric data, '%' , at line 390 column 10.
NOTE: Invalid numeric data, '&' , at line 390 column 10.
NOTE: Invalid numeric data, '*' , at line 390 column 10.
NOTE: Invalid numeric data, '(' , at line 390 column 10.
NOTE: Invalid numeric data, ')' , at line 390 column 10.
NOTE: Invalid numeric data, '+' , at line 390 column 10.
NOTE: Invalid numeric data, '-' , at line 390 column 10.
NOTE: Invalid numeric data, '=' , at line 390 column 10.
ALPHA=abcdefghijklmnopqrstuvwxyz_.~!@#$%&*()+-= MISS=. I=42 _ERROR_=1 _N_=1
NOTE: The data set WORK.W has 41 observations and 2 variables.
NOTE: The DATA statement used 0.14 seconds.
394
395 options nocenter;
396 proc print; run;
NOTE: The PROCEDURE PRINT used 0.01 seconds.
-----Original Message-----
From: Chakravarthy, Venky
Sent: Friday, March 16, 2001 1:17 PM
To: 'SAS-L@LISTSERV.UGA.EDU'
Subject: Re: Character Values in a Numerical Column
I had a private chat with Ron Fehd about his message and he thinks that I
should also forward it to SAS-L:
Regards,
Venky
<<<
Ron
p.s.: this message would be appropriate to send to SAS-L so it would be in
the archives.
>>>
********* Private message to Ron Fehd ******;
Ron,
The SAS documentation on missing values (SAS Language Reference Version 6,
p36) states :
"You can designate up to 27 special missing values (the letters A through Z
and the special character underscore (_)) ..."
It makes no mention of the possibility of using . as an additional missing
value. My small test (see below) seems to indicate that the general missing
(.) value cannot be used along with special missing values.
Most likely this discussion is at best academic. Personally I cannot think
of a situation where I have had to deal with more than a handful of missing
value types.
Or am I missing something obvious? Always possible.
Regards,
Venky
225 data w;
226 missing a b c d e f g h i j k l m n o p q r s t u v w x y z _ .;
-
36
227 length alpha $28 miss 8;
228 alpha='abcdefghijklmnopqrstuvwxyz_.';
229 do _i_=1 to 28;
230 c=substr(alpha,_i_,1);
231 miss=c;
232 output;
233 end;
234 run;
ERROR 36-169: . is an invalid special missing value. Only letters A through
Z and _ can be used.
NOTE: Character values have been converted to numeric values at the places
given by: (Line):(Column).
231:7
NOTE: The data set WORK.W has 28 observations and 4 variables.
NOTE: The DATA statement used 0.1 seconds.
235 data w;
236 missing a b c d e f g h i j k l m n o p q r s t u v w x y z _ /*.*/;
237 length alpha /*$28*/ $27 miss 8;
238 /*alpha='abcdefghijklmnopqrstuvwxyz_.';*/
239 alpha='abcdefghijklmnopqrstuvwxyz_';
240 do _i_=1 to 27;
241 c=substr(alpha,_i_,1);
242 miss=c;
243 output;
244 end;
245 run;
NOTE: Character values have been converted to numeric values at the places
given by: (Line):(Column).
242:10
NOTE: The data set WORK.W has 27 observations and 4 variables.
NOTE: The DATA statement used 0.22 seconds.
246 data w;
247 missing a .;
-
36
248 length alpha $2 miss 8;
249 alpha='a.';
250 do _i_=1 to 2;
251 c=substr(alpha,_i_,1);
252 miss=c;
253 output;
254 end;
255 run;
ERROR 36-169: . is an invalid special missing value. Only letters A through
Z and _ can be used.
NOTE: Character values have been converted to numeric values at the places
given by: (Line):(Column).
252:10
NOTE: The data set WORK.W has 2 observations and 4 variables.
NOTE: The DATA statement used 0.3 seconds.
-----Original Message-----
From: Fehd, Ronald J. [mailto:rjf2@CDC.GOV]
Sent: Friday, March 16, 2001 10:35 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Character Values in a Numerical Column
> From: Jie Qin [mailto:c674010@YAHOO.COM]
> Hi, folks. I have a sas dataset in unix. There is a
> numerical column containing character values (A, M)
> for some records. I use proc contents to get
> confirmation that the data type of this element is
> numerical. I will guess the person who create this
> dataset use option statement to define all missing
> values as M. But this explanation can not answer why I
> have another character A in this numerical column. The
> problem is I don't have the program which create this
> dataset. Are there anybody who have any idea about
> this situation? Thanks in advance.
you need to know that SAS has 28 values for numerical missing:
.A:.Z ._ and just plain dot
while these values may print and appear to be character,
they should show up in some procs like FREQ as missing
Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
OpSys: WinNT Ver: 8.1
---> cheerful provider of UNTESTED SAS code!*! <---
e-mail your SAS improvements to: suggest@sas.com
archives: http://www.listserv.uga.edu/archives/sas-l.html
remember perspective: the error is not always where it seems to occur! --
RJF2