Is there a way to determine which values SAS is treating as missing?

Reply
N/A
Posts: 1

Is there a way to determine which values SAS is treating as missing?

Hi there,

SAS doesn't have a "data view" and a "variable view" the way that SPSS does, and so to my knowledge, there's no way to look up what values have been assigned to missing in SAS, such as -9s or -8s?

This might be an issue if one has read in data from SPSS, or used StatTransfer to transfer the file from another program into SAS.

Is there a way to get SAS to tell me what values (such as -9s or -8s) it is recognizing as missing?  There is PROC CONTENTS, but to my knowledge, that doesn't have data on what is coded as what.

Thanks in advance for any help you can provide!

Lisa

Super User
Super User
Posts: 6,497

Re: Is there a way to determine which values SAS is treating as missing?

SAS has 28 special missing value ., ._, .a, .b, ..... ,.z that work for all numeric variables.  You do not need to enter dummy valid numbers like 9 or -9  as you would in SPSS.  So you do not need to somehow tell it later to treat these as something other than they appear.

If you already have read your data into variables then you can recode them using a data step.

data new; set old ;

  if x=-9 then x=.; else if x=-8 then x=.a;

run;

If you are just using the data as categories then in you might be able to just fix it using formats.

proc format ;

  value miss89f -9,-8 = ' ' other=[f2.];

run;

proc freq data=old;

  format x miss89f.;

  tables x;

run;


Super User
Super User
Posts: 6,497

Re: Is there a way to determine which values SAS is treating as missing?

If your data is coded then you would normally expect to see in the PROC CONTENTS output ( or in the interactive VAR window) the format that is attached to the variable.  You can then use PROC FORMAT to view the definition of the format.  Note that for SAS only the name of the format is permanently attached to the variable in the dataset.  The formats themselves are stored in format catalogs.

Ask a Question
Discussion stats
  • 2 replies
  • 202 views
  • 0 likes
  • 2 in conversation