Please note the text:
"the data you posted does not illustrate this"
I am not sitting at your desk looking at your data, the data you posted does not illustrate the problem.
What is it your actually trying to do here? It looks like you creating a format based on a range of observation numbers. That doesn't seem like a good idea - logical position in a dataset is not fixed (sorts for instance will change that).
If you want to flag certain records, then retain the flag variables and do your logic as you go through the dataset. You seem to be doing this anyways in the dataset which creates the formats dataset, just remove the formats part and do that directly on your data?
... View more