Generate All Unique Permutations of an Array in SAS
问题 In SAS if I have a string or an Array like the following, array x[4] $1 ('A' 'B' 'C' 'D'); I need to generate all "Unique" permutations of the elements like the following, [ABCD] [ABC] [BCD] [ACD] [ABD] [AB] [AC] [AD] [BC] [BD] [CD] [A] [B] [C] [D] Is there a function in SAS for generating all possible combinations of the array? 回答1: Assumption : I believe you are looking for combinations and not permutations , so the order does not matter, BA and AB are same thing. Use call allcomb