I am new to sas, i have two datasets as following,
data datasetA;
input a $1;
datalines;
1
2
3
4
5
6
7
;
run;
data datasetB;
input a $1;
datalines;
1
3
5
7
;
run;
If a appears B, then my desired output should be
1 Y
2 N
3 Y
4 N
5 Y
6 N
7 Y
I would suggest you to google
SAS merge
orSAS proc sql join
for introduction to basic concepts.This can be achived by in at least two ways:
merge
via thedata step
orleft join
with theproc sql
.This pdf compares pros and cons of merge versus sql in sas.
Since rbet showed you how to do this with the merge step, I'll show you how to do it with the
proc sql
.