LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (September 2002, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 30 Sep 2002 11:16:35 -0400
Reply-To:     Marianne Whitlock <WHITLOM1@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Marianne Whitlock <WHITLOM1@WESTAT.COM>
Subject:      Re: cartesian product
Comments: To: Kent Skovgaard <kesedu@MAIL1.STOFANET.DK>
Content-Type: text/plain; charset="iso-8859-1"

Another way to do a Cartesian product in a data step is:

data dec ; input id $char3. ; cards; AAA BBB CCC ; data del ; input id $char3. ; cards; DDD EEE ; data DesCartes (keep=dec_id del_id); set dec(keep=id rename=(id=dec_id)); I = 0 ; do i = 1 to nobs ; set del(keep=id rename=(id=del_id)) point = i nobs=nobs; output; end; run; proc print data = DesCartes; run;

-----Original Message----- From: Kent Skovgaard [mailto:kesedu@MAIL1.STOFANET.DK] Sent: Sunday, September 29, 2002 2:25 PM To: SAS-L@LISTSERV.UGA.EDU Subject: cartesian product

I often have to create the cartesian product of 2 or more datasets. I use Proc SQL to do the work, but I wonder if it is possible do create the cartesian product in a "normal" SAS dataste and if it is more efficient than the sql-procedure.

Thank you.

Kent Skovgaard


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