This relates to one of my previous questions (SAS - Creating combinations of different independant variables with lags). The HAVE matrix looks like below. Is there an easy way in SAS to create combinations from variables appearing in the multiple columns? E.g. columns headings Var1, Var2, Var3 - Var1 Var2 Var3
VarA VarB VarC
VarA1 VarB1 VarC1
..
VarA4 VarB4 VarC4
The combinations would be either - a) selecting any two columns e.g. Var1 and Var2 and then selecting one element from each column e.g. one combination could be VarA1 VarB2 b) selecting all columns and one element from each. I want to have all such possible combinations in a) and b). I searched through for this including proc plan but couldn't get much. Is there is proc to do all such combinations for multiple columns?
PS: VarA, VarA1, ..VarB, VarB1,..all of them are just text/strings.
Thanks
To add, I saw through http://support.sas.com/documentation/cdl/en/sqlproc/63043/HTML/default/viewer.htm#n082a03omu3i21n1k889zfklh4ps.htm which could work for 2 columns, but would get cumbersome with multiple columns..
! [EDIT] WANT matrix could be something like below (considering only two lags ..)
VarA VarB
VarA VarB1
VarA VarB2
VarA1 VarB
VarA1 VarB1
VarA1 VarB2
… …
VarB VarC
VarB VarC1
VarB VarC2
VarB1 VarC
VarB1 VarC1
VarB1 VarC2
… …
VarA VarC
VarA VarC1
VarA VarC2
… …
VarA VarB VarC
VarA VarB VarC1
VarA VarB VarC2
VarA VarB1 VarC
VarA VarB1 VarC1
VarA VarB1 VarC2
VarA VarB2 VarC
VarA VarB2 VarC1
VarA VarB2 VarC2
… … …