Date: Wed, 9 Jun 2004 14:07:36 +0000
Reply-To: iw1junk@COMCAST.NET
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ian Whitlock <iw1junk@COMCAST.NET>
Subject: data lost after merge ?
David,
What do you mean by "After the merge the variable partner is lost."? Do you mean the variable is there, but missing? or the variable is no longer present?
Since I don't believe the second without evidence, I assume the former. If I had to guess without looking at the data, my guess would be that PARTNER is on both files and missing for the records of interest in the second file.
If you want to debug your problem start with the two datasets going into the merge. Keep just D_ENTRY_ID and PARTNER from G1 and D_ENTRY_ID for PATNERLIST2. Does the code work?
If not then make a small sample of data to illustrate the problem and post to SAS-L.
--
Ian_Whitlock@comcast.net
Date: Tue, 8 Jun 2004 10:58:20 -0700
Reply-To: David Fickbohm <DavidF@HOMEGAIN.COM>
From: David Fickbohm <DavidF@HOMEGAIN.COM>
Subject: data lost after merge ?
Content-Type: text/plain; charset="iso-8859-1"
People,
I am running SAS 8.1 in a windows environment.
I am running the code below. The code works great. The variable Partner has
"EZD" or "homegain 1000" after the first datastep. The variable partner is
available down to where the merge occurs. After the merge the variable
partner is lost.
Can someone please help me understand why ?
Thanks
Dave
data PRTformat_g1 (drop=_name_);
retain d_entry_id Metric;
set PRTformat1_g1;
if _name_='Total_AE_Buyers' then Metric='Total AE Buyers
';
if _name_='Proposals_Submitted_OnRUNdt' then Metric='Proposals Submitted On
Run Date
';
if _name_='Cumulative_proposals' then Metric='Cumulative Proposals
';
if _name_='Unique_ComeBack_Rundt' then Metric='Unique number of profilers
who came back
to the Consumer Control Center on Run Date ';
if _name_='Cumulative_Unique_ComeBack' then Metric='Cumulative unique
profilers who came
back at least once as of Run Date ';
if _name_='Percent_Unique_ComeBack' then Metric='% of unique profilers who
came back
';
if _name_='Proposals_FullRead_Rundt' then Metric='Number of detail
proposals read on run date
';
if _name_='Cumulative_Proposals_FullRead' then Metric='Cumulative number of
detail proposals
read as of run date ';
if _name_='Percent_Proposals_FullRead' then Metric='% of detail proposals
read
';
if D_entry_ID=1000 then Partner='HomeGain 1000 ';
if d_entry_id ne 1000 then Partner='EZD ';
run;
data partnerlist2;
length d_entry_id $11;
set partnerlist;
x_entry_id = entry_id;
d_entry_id = left(x_entry_id);
run;
proc sort data=PRTformat_G1 out = g1;
by d_entry_id;
run;
proc sort data = partnerlist2;
by d_entry_id;
run;
data buyer_wnamea;
merge g1 (in = a)
partnerlist2 (in = b);
by d_entry_id;
if a = 1 and b = 1;
run;
Dave Fickbohm
Data Mining Analyst
Homegain+
2450 45th St.
Emeryville, CA, 94608
Phone 510 655 0800 ext 4151