I'm new to SAS and have a problem that I would solve using SQL cursors in other languages but can't find any reference to them in SAS. Does SAS have a similar concept or can anyone recommend another technique to solve the following.
I have 2 datasets; the first containing a number of customer-related variables including UK postcode and the second containing a list of postcode changes (the UK post office does change geographical post codes from time to time). The postcode on the customer file is that recorded when the customer first registered. This could, subsequently, have changed and we need to run some analysis on current postcodes.
The second file contains 3 variables; old post code, new post code and date of change. It's possible for a postcode to change multiple times so postcode A could become postcode B, which could then later change to postcode C. In such a case we'd want to record the current postcode of any customer originally registered at postcode A as being postcode C.
I'd like to be able to take each record on the customer file in turn and walk the postcode changes file to be able to track the chain of changes made for that customer's postcode.
The only way of doing this that I've found so far is to have a series of iterative joins but there has to be a more efficient way of doing this.
Thanks, in advance, for any suggestions.
... View more