13data work.spm(keep=
id n c);
14 id=1; n=._; c=
'a'; output;
15 id=2; n=.A; c=
'b'; output;
16 id=3; n=.; c=
'c'; output;
17 id=4; n=42; c=
'd'; output;
21%mp_ds2inserts(work.spm,outref=testref,schema=work,outds=copy,flavour=SAS)
26 infile testref end=eof;
29 if index(_infile_,
'n=._') or index(_infile_,'n=.A') then found+1;
30 if eof then call symputx('periodflg',found,'l');
33 iftrue=(&periodflg=2),
34 desc=Checking the period is written for special missings,
35 outds=work.test_results
40 if 0 then set work.spm;
51 if 0 then set work.copy nobs=nn;
52 call symputx('copyobs',nn,'l');
57 desc=Checking all four rows were inserted,
58 outds=work.test_results
63proc sort data=work.spm out=work.spm_s;
66proc sort data=work.copy out=work.copy_s;
71 merge work.spm_s(in=a rename=(n=n_exp c=c_exp)) work.copy_s(in=b) end=eof;
74 if not (a and b) then bad+1;
75 else if n ne n_exp or c ne c_exp then bad+1;
76 if eof then call symputx('valfail',bad,'l');
80 desc=Checking inserts round trip special missing values,
81 outds=work.test_results