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 (January 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sat, 3 Jan 2004 08:49:08 -0500
Reply-To:     Sigurd Hermansen <HERMANS1@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Sigurd Hermansen <HERMANS1@WESTAT.COM>
Subject:      Re: Merge and delete (Sas Newbie)
Comments: To: Microstructure <randistan69@HOTMAIL.COM>
Content-Type: text/plain; charset="iso-8859-1"

To obtain a new dataset that contains the rows of data in File1 and File2 that have the same value of variable A:

proc sql; create table new12 as select t1.*,t2.C,t2.K from File1 as t1 inner join File2 as t2 on t1.A=t2.A ; quit;

The inner join selects rows in the intersection of the sets of File1.A and File2.A values. That means that the values have to match exactly. Duplicates of company symbol in either File1 or File2 will appear in the solution. Duplicates in File1 and duplicates in File2 will produce multiple pairs of the rows. Sig -----Original Message----- From: Microstructure To: SAS-L@LISTSERV.UGA.EDU Sent: 1/3/2004 1:39 AM Subject: Merge and delete (Sas Newbie)

Hey guys: I have two files: File One has variables: Date Variable A Variable B Variable M Variable N... File Two has variables: Date Variable A Variable C Variable K Variable J.... Variable A is the Company Symbol. The Company Symbol appearing in File Two is a subset of the of Variable A (Company Symbol) appearing in File 1. I want to keep only the common company symbols in these files and delete the others. Any suggestions. Do you need more information???


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