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
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;
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.