@niravparekh113 wrote:
How can we match anywhere (any observation) between var1 and var2 from both dataset, and create YES/NO flag is it match
data a;
infile datalines truncover; input va1 $80.; datalines; 1577026 1577026,239684,239696,240005,318992,1577026,924616,924749 924767,924652,1208821 924767,924652,1208821 ; run;
data b; infile datalines truncover; input va2 $80.; datalines; 239684,239696,240005,318992,1577026,924616,924749,1577026 12345 924767,924652 924767,924652,1208821 ; run;
/*result - Match flag*/
If there is nothing to actually join the data sets on such as the ID in the above example then you have issues that will arise from having to compare ALL of records in one data set to ALL of the records in the other set and then figuring out a way to reduce tit to just those 4 comparisons. Can you describe a rule for why we compare:
924767,924652,1208821 to 924767,924652
in the desired result but do not compare:
924767,924652,1208821 to 12345?
Without rules as to how to match which strings to compare, reducing the output to 4 of the 10 or 16 basic comparisons between 4 records in two sets is very problematic.
If this one piece of a larger process you might need to 1) start another thread on the forum, 2) Provide more concrete examples of the input data sets and the results and 3) describe where all of this actually headed overall.
... View more