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 (January 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 15 Jan 2002 14:44:20 -0800
Reply-To:     gwarnick@fhcrc.org
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         greg warnick <gwarnick@SNAP.FHCRC.ORG>
Organization: Fred Hutchinson Cancer Research Center
Subject:      Re: a question on merge
Content-Type: multipart/alternative;

--------------48BB9FD865870333C96BA56F Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit

i think this is what you're looking to do, it involves a new variable though to show source of data. :-!

data both ; set ps94 (in=ps94) ps95 ; if ps94 then year = 1 ; else year = 2 ; run ;

Zhonghe Li wrote:

> Hi everyone, I have two files (PS94 and PS95). They contain same variables (same variable name) > for two different years. Now I need to merge them into one file, but I need all the two year > variables in the file. Is there an easy way to do so without renaming the variables (a lot > variables to rename)? Thank you for your help. Zhonghe

--------------48BB9FD865870333C96BA56F Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <body bgcolor="#FFFFFF"> i think this is what you're looking to do, it involves a new variable though to show source of data. :-! <p>data both ; <br>&nbsp;&nbsp; set ps94 (in=ps94) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ps95&nbsp;&nbsp; ; <br>&nbsp;&nbsp; if ps94 then year = 1 ; <br>&nbsp;&nbsp; else year = 2 ; <br>&nbsp;&nbsp; run ; <p>Zhonghe Li wrote: <blockquote TYPE=CITE><style></style> <font face="Arial"><font size=-1>Hi everyone,</font></font>&nbsp;<font face="Arial"><font size=-1>I have two files (PS94 and PS95).&nbsp; They contain same variables (same variable name) for two different years.&nbsp; Now I need to merge them into one file, but I need all the two year variables in the file.</font></font>&nbsp;<font face="Arial"><font size=-1>Is there an easy way to do so without renaming the variables (a lot variables to rename)?</font></font>&nbsp;<font face="Arial"><font size=-1>Thank you for your help.</font></font>&nbsp;<font face="Arial"><font size=-1>Zhonghe</font></font></blockquote>

</body> </html>

--------------48BB9FD865870333C96BA56F--


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