I'll admit I'm a neophite. I wish I had the code that botched my sorting. I've already replaced it with code that works (I generally like to destroy non-working code as quick as possible)
However, I'm certain I had a well laid out logic that didn't work when it was built into the if/then statement... and worked as soon as I created a stand-alone variable.
Needless to say, a learning experience, and I hope that I will come to better understand how this works in the future. I've not worked with data like this before and I'm learning all sorts of new and fun things.
At least I can tell when something is not working
Can anyone suggest a good tutorial for more advanced data step functions?
This sort of thing (http://www2.sas.com/proceedings/sugi30/134-30.pdf) I know inside and out.
A fairly simple article that describes the problem with using the lag function, conditionally, is shown at: http://www.nesug.org/proceedings/nesug06/cc/cc32.pdf
There is a site that has all of the global forum papers as well as many of the regional papers: http://www.lexjansen.com/
There is always the documentation: http://support.sas.com/documentation/93/index.html
and sasCommunity.org articles: http://www.sascommunity.org/wiki/Main_Page
and many, many books by SAS users: http://support.sas.com/community/authors/index.html
Two authors you can look for: Ron Cody and Ben Cochran. You may have to search through the titles, though, to find the papers you're looking for.
Good luck.
Astounding: Absolutely nothing wrong with reading those authors, but I definitely wouldn't limit who I'd suggest reading. There are many, many outstanding authors and not all of them have elected to write books. I'd list some of my own favorites, but that would take a book in itself.
Art,
The two I mentioned are well-respected, and I know they have written on the subject at one time or another. But you're certainly right. There must be others as well.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.