I have been looking for a command in SAS/IML which finds the location of the matched values in two different vectors.
I came across this website: http://stackoverflow.com/questions/4952548/value-matching-in-sas-iml where the same question was asked and the suggested answer was to use XSECT function to find the intersection of the two sets. However, XSECT function gives the common elements between two sets rather that giving the location of those elements.
For example, in the following code:
proc iml;
x={10 11 12 13 12 13 14 15};
v={12 13};
z=xsect(x,v);
print z;
quit;
the SAS result is: Z= {12 13}, but I’mlooking for a vector like {3 4 5 6} which is the location of common elements of vector V in vector X.
Would anybody help me with the appropriate function inSAS/IML?
Thank you very much.