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 (May 1998, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 6 May 1998 14:56:24 -0400
Reply-To:   Claudia Bullock <CBullock@HCFA.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Claudia Bullock <CBullock@HCFA.GOV>
Subject:   re : Compare Variables from 2 data sets - reply

The following code reads in Abdu's two sample input files, as raw data files, produces the appropriate SAS output file, and prints it. This code incorporates Mike Rhoads idea about interleaving the two data sets.

data a; source='a'; input x; cards; 5 9 11 23 29 35 ; run;

data b; source='b'; input x; cards; 3 10 15 19 27 31 37 43 ; run;

data ab; set a b; run;

proc sort data=ab; by descending x descending source; run;

data c (keep=x newvar); retain counter 0; set ab; if source = 'a' then do; newvar=counter; output; end; else; if source = 'b' then counter=counter+1; run;

proc sort data=c; by x; run;

proc print data=c; run;


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