I have a 'have' and 'want' table below. The have represents two separate accounts, one has single digits, the other double. Looking at the single digit account: Notice the cust_ref field associates the first with the second, the second with the third, and the third back to the second, but the third has no link direclty back to the first. I have a dataset that is over 5 million and growing. I'm interested in a solution that will link all of these accounts and get me a good orig_account. If it is the first one based on the date field that's great but no necessary.
data HAVE; infile cards dsd; input ACCTNUM cust_ref date; cards; 1, 1, 1 1, 1, 1 1, 2, 1 2, 1, 1 2, 2, 2 2, 3, 2 3, 2, 2 3, 2, 3 3, 3, 3 10, 10, 1 10, 10, 1 10, 11, 1 11, 11, 1 11, 11, 2 11, 12, 2 12, 11, 2 12, 11, 3 12, 12, 3 ;run; data want; infile cards dsd; input ACCTNUM cust_ref date orig_acct; cards; 1, 1, 1, 1 1, 1, 1, 1 1, 2, 1, 1 2, 1, 1, 1 2, 2, 2, 1 2, 3, 2, 1 3, 2, 2, 1 3, 2, 3, 1 3, 3, 3, 1 10, 10, 1, 10 10, 10, 1, 10 10, 11, 1, 10 11, 11, 1, 10 11, 11, 2, 10 11, 12, 2, 10 12, 11, 2, 10 12, 11, 3, 10 12, 12, 3, 10 ;run;
Thank you for any help
... View more