All my missing values are being deleted when I do not wish them to be. I am assuming SAS and Oracle are not playing nice - but I do not know the solution. Thank-you if you can offer any ideas about this error.
Observe the character field SEX has missing values:
data test ;
input name $ sex $ age city $;
if sex = "NA" then sex=' ';
if city = "Unk" then city = ' ';
cards;
Gene M 62 Saginaw
Cyndi F 45 Unk
Alice NA 51 Bay City
Bob M 55 Unk
;
proc print data=test; run;
Observe that I can filter on SEX and still have the missing value:
proc sql;
create table que1 as
select * from test where sex
not in ('F','M');
quit;
proc sql; select * from que1; quit;
Observe a vanilla data pull from an Oracle table via a libname connection:
proc sql;
create table test as
select * from dss.student_registrations
where term_code gt '201500'
and row_type = 'E'
/* and final_grade not in ('AU','WU') */
;quit;
proc freq data=test; tables final_grade / missing; run;
Now I place the limit on final_grade and all the missing values disappear:
proc sql;
create table test as
select * from dss.student_registrations
where term_code gt '201500'
and row_type = 'E'
and final_grade not in ('AU','WU')
;quit;
proc freq data=test; tables final_grade / missing; run;