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 (June 2005, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 26 Jun 2005 20:13:52 -0500
Reply-To:     baogong jiang <bgjiang@gmail.com>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         baogong jiang <bgjiang@GMAIL.COM>
Subject:      Re: how to create a matrix in sas?
Comments: To: yue@yahoo.com
In-Reply-To:  <1119666444.534568.166280@g47g2000cwa.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1

hi,yue,

A self join will work:

data yourdata; input name $ age gender $; cards; A 5 M B 9 M C 7 F ;

proc sql; select a.name, a.age, a.gender from yourdata as a, yourdata as b; quit;

HTH

baogong

On 6/24/05, yue@yahoo.com <yue@yahoo.com> wrote: > for example, i have the following dataset > > name age gender ..... > A 5 M > B 9 M > C 7 F > > I want to get all possible combination between name and age to get > output like this > > name date gender ..... > A 5 M > A 9 M > A 7 M > B 5 M > B 9 M > B 7 M > C 5 F > C 9 F > C 7 F > > can this be done by merging with itself? > > TIA >

-- Baoogng Jiang Department of Agronomy Lousisana State University


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