| Date: | Fri, 12 Jun 1998 14:53:09 -0500 |
| Reply-To: | Dong Li <dongli@TAMU.EDU> |
| Sender: | "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU> |
| From: | Dong Li <dongli@TAMU.EDU> |
| Organization: | Texas A&M Univ |
| Subject: | Re: Merge file |
| Content-Type: | text/plain; charset=us-ascii |
Thanks to you all, Eric, Frank, and Richard. I now can use MERGE to deal with
it. You all have a nice weekend! --Dong
Frank Cunliffe wrote:
> Dong Li (dongli@tamu.edu) wrote:
> : Forgive me if this question is too simple. I need to combine two data
> : sets. Suppose one data set has ID, AGE, and RANK for a lot of
> : individuals. Another data set has RANK and WAGE. Suppose in the second
> : data there are only five observations since there are only five
> : different ranks. Now I want to combine these two data sets so that the
> : resulted data set has ID, AGE, RANK, and WAGE. I can't find anything in
> : the SAS Language and Procedures.
>
> Chapter 13 of "SAS: A Gentle Introduction" by Frank DiIorio has
> a lot of information on various ways to merge data sets. Here,
> however, it may be simpler to use something like the following:
>
> data big_data;
> input id age rank $;
> if rank='general' then wage=80000;
> else if rank='colonel' then wage=60000;
> else if rank='major' then wage=40000;
> else if rank='captain' then wage=30000;
> else if rank='lieut.' then wage=25000;
>
> - Frank
|