tags:

views:

36

answers:

2
+3  Q: 

.z syntax in SAS

I found this paper on SAS that includes (on the first page and some other parts) the following line of code:

if trt1pn > .z then...

I was wondering what the purpose of it can be. I had never seen the ".z" expression before. I though (and some colleagues of mine thought the same) it was a typo. But you can do

data kk;
   a = .z;
   b = .b;
run;

and you get variable a equal to "Z" and variable b equal to "B".

Where in the SAS manuals is this discussed? What can it mean? Why is it used in the paper in such way?

+3  A: 

SAS has 28 different missing values (., ._, .A-.Z) with '.' being the default. these special missing values can be set based on the reason the value is missing. Is the data point not applicable, then '.N' could be used.

Additionally, these missing values can be formatted via custom formats (proc format) easily.

Proc format;
  Value Response
    1='Yes'
    0='No'
    .U='Unsure'
    .N='Not Applicable'
    .R='Refused to Answer';
Run;
rkoopmann
and here's more information from SAS: http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#/documentation/cdl/en/lrcon/62955/HTML/default/a000992455.htm
Louisa Grey
+2  A: 

For a numeric variable, there are 28 different missing values (._, ., .A, .B, ... ,.Z). They are "smaller" than all numbers. Among them, the smallest is the dot-underscore(._) and the largest the dot-Z(.Z). Thus, the line:

if trt1pn > .Z then ...

can be re-written using the missing() function:

if not missing(trp1pn) then ...

which is a bit clearer.

Chang Chung