LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 16 Sep 2009 10:58:29 -0500
Reply-To:     "Data _null_;" <iebupdte@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Data _null_;" <iebupdte@GMAIL.COM>
Subject:      Re: create combinations in SAS
Comments: To: Aj <ajeetsubramanian@gmail.com>
In-Reply-To:  <c7c8a198-1b13-44f6-a32c-e60ee9acbe6e@d15g2000prc.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1

I thought someone post a data step by now. I am too lazy to do this with a data step. I'm not sure what the maximum value of N can be with this method, so be aware of that.

PROC SUMMARY by default produces the combinations you seek. You can then use a data step to create a single variable if you like.

data variables; input Variables:$32.; cards; Age Height Weight Colour Blue Red Orange Sex BMI ;;;; run; proc transpose out=vars; var var:; run; proc print; run; proc summary data=vars chartype; class col:; output out=combinations; run; proc print; run; data oneVarOfCombinations; length list $32767; set combinations; list = catx(' ',of col:); keep list; run; proc print; run;

On 9/16/09, Aj <ajeetsubramanian@gmail.com> wrote: > Hi all > > Consider a dataset with 'n' values in it > > Varibles > Age > height > weight > colour > > .... > ... > I want to create all possible combinations with these variables such > as > > 1. age height > 2.age weight > 3. age colour > 4. age height weight > 5. age height weight colour > 6. height weight colour > 7. age weight colour > ... > ... > ... > ... > > > Any pointers will be helpful. > thanks > Aj >


Back to: Top of message | Previous page | Main SAS-L page