i get questions and emails like 'can you look at proc/sql/ddl x and make it better' all the time. so, i figured i would publish my answers or refactors here for public scrutiny. i think i've seen several blogs that do something similar like this. learning from your questions... ? whatever. here is one i got the other day
proc description:
update a statistics table called typetables. this table has stats about lookup type tables of some sort. one of the stats is a measurement of a two subtypes. i don't know, but i can only assume this information is being tracked...