PROC SCAPROC may be an option but I'm not aware of anything that will tell you only variables references. The ability to use short cut references or macro variables also make it difficult to create a program scanner to do this as well though people have tried. You can find examples of code/log parsers on lexjansen.com