Hello,
I have a SAS dataset (dataset name= Gold) with special missing (.A .B .D) in 400 various variables (such as Age, Weight, Sex, Race).
A colleague who uses SPSS will be using this dataset and when I export it to a CSV file, the special missing appears as text (A B D etc).
I will appreciate help converting all the special missing to regular missing (.) in the various variables.
Thanks
Sackey
You can use an ARRAY to go through all variables and convert them to regular missing.
Something like this
data want;
set have;
array check a b c d e; /* Your actual variable names go here */
do i=1 to dim(check);
if missing(check(i)) then check(i)=.;
end;
run;
You can use an ARRAY to go through all variables and convert them to regular missing.
Something like this
data want;
set have;
array check a b c d e; /* Your actual variable names go here */
do i=1 to dim(check);
if missing(check(i)) then check(i)=.;
end;
run;
If you have in a column a character like 'A' - how can you know if it is the '.A' in origin (i.e. missing value) or the real 'A' character ?
In case all thus variables shuould be numeric then you can check for numbers (digits) otherwise it is a missing value.
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.