Thanks for that Xia, that is really helpful. It works on the sample data, but should it work when adding more data? For example, I tried the following sample data (adding data for 26APR2015, where accounts were in the same queues): data have; input AccNum $ Queue ExtractDate : date9.; cards; A001 1 26APR2015 A002 1 26APR2015 A003 2 26APR2015 A001 1 27APR2015 A002 1 27APR2015 A003 2 27APR2015 A001 1 28APR2015 A002 1 28APR2015 A003 2 28APR2015 A001 3 29APR2015 A002 3 29APR2015 A003 4 29APR2015 ; run; But it didn't quite yield the expected results, For example, I would want to see 2 observations for A001, one with the row start date 26APR2015 & Row end date 28APR2015 in queue 1 then the second observation for A001 to show row start date 29APR2015 and row end date 31DEC9999. Thanks again for your help
... View more