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?
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
merge perm.men perm.occ;
merge perm.women perm.occ;
set men women;
- 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
> >> 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
> >> email@example.com
> 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 (firstname.lastname@example.org)