Hey, I have a regular incoming feed of data, and am using the DATA step with the UPDATE function. It is a feed of vehicles which have returned for routine maintenance. When the car is sold, we get records for every covered service period, with an OPEN flag. The unique variables I am using to update are VIN and Mileage (5k, 10k, etc..). Then as the service is completed, it moves to COMPLETED. My problem is, some records are showing back up as OPEN, which is being overwritten. Ex: VIN #1 is sold, and it creates all the OPEN records (5 lines) for the 5 different mileage intervals. As VIN #1 returns for service, I get another record with VIN 1, 5k, and status COMPLETED. 2 weeks later, I get bad data saying VIN 1 at 5k is now OPEN. Data update will overwrite with bad data. My thought: As it is imported, create a new variable (let's call it "priority") and assign a 0 for OPEN and a 1 for COMPLETED. Can I update Vin 1, 5k, only if the Priority in the new record is greater than the existing record? Any other thoughts to this issue? Besides going back to the data team and getting laughed at? Thanks a ton!
... View more