Hello, I am trying to test whether or not records of a particular category all have consistent values in 3 fields, ideally within a data step (no other reason than this is how all of the other tests are done, and I'm a sucker for consistency). Unfortunately this is work related, and the data is highly confidential... but I believe I can very closely align this to a typical "store front" type data structure for all intents and purposes. There are 5 key fields I need to consider within this metaphor. Account Number, Order Number, Store Name, Product Name, Product Price. I need to test that for each Account Number, for each Order Number... Store Name, Product Name, and Product Price are all consistent (the same). Where this analogy breaks from reality. is that the Store Name / Product Name / Product Price can be different for different Accounts... but for each Account, they must be the same. I would love to share a code sample, but I feel as though Data Steps can only look at 1 records at a time so I'm just not sure how to even get started... But maybe a mock data sample might help. The desired result here, is that due to Order 003 being different... all 3 records get flagged as inconsistent. (My tests all return a 0 or a 1 for pass/fail in the summary report.) Account # Order # StoreName ProductName ProductPrice 00000001 001 Store1 Product1 100.00 00000001 002 Store1 Product1 100.00 00000001 003 Store2 Product1 100.00 Each account can have any number of Orders. I read up on being able to look at the previous/next row... but I couldn't ascertain how to apply that to my given situation. I thought maybe I would simply need to iterate... Compare 001 to 002, then 002 to 003... But that thought line died when I asked myself how I would then update 001 to flag as fail if 002 vs. 003 failed the integrity check. I feel at this point I'm over complicating and over thinking the problem. Any assistance is much appreciated. I apologize for the lack of code and real data. Best Regards, -Kade
... View more