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 (November 1999, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 16 Nov 1999 12:43:57 +0800
Reply-To:     Wen-Feng Hsiao <d8442803@STUDENT.NSYSU.EDU.TW>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Wen-Feng Hsiao <d8442803@STUDENT.NSYSU.EDU.TW>
Organization: MIS
Subject:      Re: comparing two datasets which are from different files.

Dear Lawrence,

It works, thanks a lot! Pardon me that I have a further question. I have two files which store the responses of subjects from two different classes separately. (Because I want to test whether these two groups are different, I store them in two files.) If I want to aggregate them (for example, I believe they are not significantly different), how can I do that in the SAS program. Maybe the easiest way is using Excel to join these two files into a new one, but I believe SAS has its own solution. Thanks for your patience.

The following code doesn't seem to work...

data set1; infile 'c:\dataset\set1.txt'; input v1 v2;

data set2; infile 'c:\dataset\set2.txt'; input v1 v2;

data set; merge set1 set2; run;


In article <>, says... > What you are doing in the first attempt is a one-to-one merge. You are > assuming that the data in dataset1 and dataset2 are arranged so that row > 1 matches up to row 1 in each data set, row 2 to row 2, etc. By using > two infile and input statement pairs, you are creating just one SAS > output dataset. > > PROC PRINT can only deal with one SAS dataset at a time, so you need to > reduce your data to one dataset before printing. You can do that in > your second example by adding the following code just before the RPOC > PRINT: > > DATA set; > MERGE set1 set2; > RUN; > > * and changing the PROC PRINT to: ; > > PROC PRINT DATA=set; > ... > > More general comparisons of datasets can be obtained by using PROC > COMPARE. >

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