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 (October 1997, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 10 Oct 1997 16:27:15 -0400
Reply-To:     Tom Abernathy <tga1@COLUMBIA.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Tom Abernathy <tga1@COLUMBIA.EDU>
Organization: Columbia University
Subject:      Re: Merge and interleave simultaneously?
In-Reply-To:  <19971010164601.MAA20097@ladder02.news.aol.com>
Content-Type: TEXT/PLAIN; charset=US-ASCII

Use VIEWS to get this done in one step. (At least only one step that does any work). Not sure how more efficient it will be in execution time.

data men/view=men; merge perm.men perm.occ; by occ; run; data women/view=women; merge perm.women perm.occ; by occ; run; data output; set men women; by occ; run;

- Tom Abernathy

On 10 Oct 1997, DNordlund wrote:

> In article <343E3D7F.EF6@louisville.stortek.com>, "Michael R. Gibson" > <gibsomrNOMORESPAM@louisville.stortek.com> writes: > > >Subject: Re: Merge and interleave simultaneously? > >From: "Michael R. Gibson" <gibsomrNOMORESPAM@louisville.stortek.com> > >Date: Fri, 10 Oct 1997 08:36:47 -0600 > > > >Have you tried a three way merge, something like: > > > > > > data output; > > > > merge perm.OCC perm.MEN perm.WOMEN; by OCC; > > > > > >this is untested by I belive it should work. > > > >Hope this helps. > > > > > >> Reeve Vanneman <reeve@Glue.umd.edu> wrote in article > ><61626k$tdk$1@hecate.umd.edu>.... > >> Does anybody know how (whether?) I can interleave a couple of large > >> sas data files and merge them with another file IN THE SAME DATA STEP? > >> I have two large census PUMS files, men and women, sorted by OCC. > >> Each is about a million records. > >> When I want to combine them into one person file, sorted by OCC, I use: > >> set perm.MEN perm.WOMEN; by OCC; > >> I then get a file with about two million records. > >> When I want to merge either of them with occ-level data I use: > >> merge perm.MEN perm.OCC; by OCC; > >> I then get a file with a million records with occ-level data attached to > >> each record. > >> I want to both simultaneously in one data step (so that I don't fill up > >> all my workspace with huge intermediate data files). > >> Reeve Vanneman > >> Univ. of Maryland > >> reeve@cwmills.umd.edu > > > > > > > > More than one peerson has suggested using a three-way merge for the above > problem, but this will not accomplish what the original poster wanted. > > For a given OCC, the above merge statement will take the first record from > perm.MEN (for that OCC), the first record from perm.WOMEN (for that OCC), > and the record from perm.OCC and make a single record. Then the same would > occur for the second record from each file (for that OCC). The original > poster wanted to interleave perm.MEN and perm.WOMEN, keeping these records > separate, then merge in occupation information. The above merge does not > do this. > > > Dan Nordlund > > > > >

- Tom Abernathy (tga1@columbia.edu)


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