Hi there,
I tried to match 2 file to generate a new file.
see below example:
File 1:
ID
code1
code2
code3
code4
11
A_B
C_D
A_C
B_D
12
A_A
D_D
A_A
B_B
14
B_B
C_C
C_C
D_D
File 2:
Code
Match1
Match2
code1
A
B
code2
D
C
code3
C
A
code4
D
B
look into code1 in file1: A_B, A_A_, B_B. I want to see if it matches with Code1 in File2 variable Match2, in this case Match2 =B
if code1 in file1 only match 1 letter then the result will be 1, if match 2 letter then the result will be 2, if No match then the result will be 0.
this is what I want.
ID
code1
Result1
code2
Result2
code3
Result3
code4
Result4
11
A_B
1
C_D
1
A_C
1
B_D
1
12
A_A
0
D_D
0
A_A
2
B_B
2
14
B_B
2
C_C
2
C_C
0
D_D
0
is there a SAS code that can run for generating the results for all variables ?
I hope it's not confusing you.
Please let me know if you need more information.
Thanks in advance!!
... View more