Desktop productivity for business analysts and programmers

Checking if a var is used in multiple formulas

Reply
Occasional Contributor
Posts: 8

Checking if a var is used in multiple formulas

Hi all,

 

Currently I have a SAS EG Project with multiple proces flows and within those quite some Query Builders and Programs.

Since it has grown and developed over time, it's time for some clean up and get rid of no longer used var's. However, in the first proces flow I can't see if a var is used in a composing another var later on and therefore I don't know if I should delete te var or not. The search option in SAS doesn't provide me with all info.

 

So, is a method available that searches multiple logs, query builders, programs for a var and displays how and where it's used?

 

Thanks in advance!

Super User
Super User
Posts: 9,193

Re: Checking if a var is used in multiple formulas

A prime example of where documentation is so important.  If the code was all planned, documented, before being written you wouldn't even need the code - hence why documentation is so much more important than code.

 

Anyways, there is a procedure called:

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a003199745.htm

Proc scaproc.

 

This runs around your code and analayses inputs, outputs and such like.  I don't think that goes down to the actual variable level though, and as far as I know there is not such a thing.  You would need to work backwards across the process documenting each part as you go.

Super User
Posts: 3,761

Re: Checking if a var is used in multiple formulas

This type of question comes up quite frequently. Yes there are tools for parsing SAS logs or for searching projects and code. As for definitively figuring out the provenance or history of a variable and whether it is still used or not, that requires a level of intelligence only human brain power can do with the current state of technology. Maybe in the brave new work of Artificial Intelligence that might change! 

Ask a Question
Discussion stats
  • 2 replies
  • 62 views
  • 0 likes
  • 3 in conversation