I got two variables, say X and Y. The value in X is with different orders of A, B and C, say ACB or BCA. I want to compare this with variable "Y", which has one only value of "ABC". Essentially, "ACB" is the same as "ABC". My question is how to compare X and Y? Is there any other way to rearrangethe value in X and then compare in addition syntax Professor Bruce Weaver at Lakehead University, Canada ?
* Generate some sample data.
DATA LIST list / X Y (2A3).
BEGIN DATA
ABC ABC
ABC ACB
ABC BCA
ABC BCD
END DATA.
LOOP # = 1 to 3.
- COMPUTE Perm = CHAR.INDEX(Y,CHAR.SUBSTR(X,#,1)) GT 0.
END LOOP if not Perm.
FORMATS Perm(f1).
LIST.