Date: Mon, 3 Jul 2006 09:18:43 -0400
Reply-To: "Rickards, Clinton (GE Consumer Finance)"
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Rickards, Clinton (GE Consumer Finance)"
Subject: Re: Merge fails to pick up ID?
Content-Type: text/plain; charset="iso-8859-1"
As you can see by your results, changing the attributes of your id variable may not have been a good thing. You might want to explain further the original problem that prompted you to change the variable because of a format.
That being said, you need to look at the physical contents of A and newB. Most likely you may not have used exactly the same method, resulting in different values. For example, one may be left justified and the other not. do something like this:
proc print data=a (obs=100);
proc print data=newB (obs=100);
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of
Sent: Friday, June 30, 2006 4:46 PM
Subject: Merge fails to pick up ID?
Hi. I have a funny situation.I have two dataset A and B and I need to
perform a simple merge by CaseID.
I did a proc contents of data A. The Caseid variable has this format
CASEID Char 24 $24. $24. CASEID
My dataset B originally has Caseid as a numeric. I did this to change the
data newB (keep=caseid raw estmm);
I checked the proc contents of the new dataset newB:
# Variable Type Len Format Informat
1 caseid Char 24
Then I tried to merge the two datasets.
data joinAB; merge A newB; by caseid; run;
But the merge failed. Essentially the two datasets were stacked up
instead---Dataset A has 1000 cases and Dataset newB has 300 cases. The
dataset after merge has 1300 cases.
Somehow the program thinks the caseids are different. How come?