|
Another question for you kind folks....
Given a macro variable that is a list of words, I need to generate
another macro variable that contains a list of all of the interaction
terms that can be derived from those words.
For example, if the list is
%LET MYLIST = JEN JOHN CHRIS;
I need a list MYNEWLIST
%PUT &MYNEWLIST:
JEN JOHN CHRIS JEN_JOHN JEN_CHRIS JOHN_CHRIS JEN_JOHN_CHRIS
The above example starts with a three-element list.
I need to make my macro flexible enough to handle any number of
elements.
The macro that I originally wrote did this in a really crude, brute
force manner by
1) creating a 10-row temp dataset with one variable for each of the
elements in the list, plus an indicator variable
2) populating this dataset with random numbers
3) running PROC ANOVA
4) using ODS to get the Means table
5) using the EFFECT variable in the Means table to get the
enumerations of the interactions
PROC ANOVA DATA=BLEH;
CLASS JEN JOHN CHRIS;
MODEL I = JEN|JOHN|CHRIS;
MEANS JEN|JOHN|CHRIS;
QUIT;
I do know that this is really a silly way to do this.
Plus --- there seems to be a limit to the size of the EFFECT variable
in the Means table.
If it gets too big, it truncates the names.
If I start with JENNIFER JOHNATHAN CHRISTOPHER
I end up with:
JENNIFER
JOHNATHAN
CHRISTOPHER
JENNIFER_JOHNATHAN
JENNIFER_CHRISTOPHER
JOHNATHAN_CHRISTOPHE
JENNIF_JOHNAT_CHRIST
which won't work in the system that I am designing.
Anyone have a better way to do this?
I have started to design the looping structure necessary -- but am
getting tangled up.
Can anyone point me in the right direction?
Does anyone know how to expand the size of the EFFECT variable in the
Means table from PROC ANOVA?
Thanks in advance,
-jennifer.
|