Another way
data have1;
infile datalines dsd DLM='09'x;
input Pol Category $ premium;
datalines;
3 g 10
6 g 3
9 h 7
12 g 20
15 g 12
18 g 100
;
data have2;
infile datalines dsd DLM='09'x;
input Pol Category $ premium;
datalines;
3 x 4
6 g 2
102 g .
15 z 12
12 g 15
18 g 200
;
proc sql;
select
case when a.pol is missing then 'NA'
else put(a.pol,8.)
end as pol,
case when a.category is missing
then 'NA' else a.category
end as category,
case when a.premium is missing
then 'NA' else put(a.premium,8.)
end as premium,
case when b.pol is missing
then 'NA' else put(b.pol,8.)
end as pol,
case when b.category is missing
then 'NA' else b.category
end as category,
case when b.premium is missing
then 'NA' else put(b.premium,8.)
end as premium
from have1 as a
full join
have2 as b
on a.pol = b.pol;
... View more