05-23-2016 02:29 PM
I am working with code that starts with some data, does some processing and changes variable names, does some processing that combines information from variables in more than one dataset, changes some of the variable names, brings in other data and changes names to variables, and on and on...
There's hundreds if not a thousand variables. I'd like to create something that shows the entire flow where you can look for a variable name in one dataset and see where it came from and where it's going.
Does anybody know where I can start? I haven't been using SAS EG in a while but I'm wondering if the code were in SAS EG if there was a feature in there that would help?
I'm using SAS 9.4 for Windows. I have a bit of experience with EG, it's just been a while but I think I could move what I have over to it if need be.
05-23-2016 06:18 PM
EG doesn't do this unfortunately.
If you can create a process that parses the code and checks the metadata of the tables used and creates a documentation with what you want, you can probably sell it successfully!
05-23-2016 06:33 PM
IF you a "changing names" using the Rename statement in its various forms you might have a chance using a number of code parsers (look for them). If your names come from things like proc transpose or the output datasets of procedures like summary, tabulate, means, report and the like it may be very difficult just to implement that code search.
What I might suggest would be to look at your processes and insert appropriate calls at the beginning to read the dictionary tables for pertinent data, save it with a name like VarsStartProcXXXX and then repeat at the end of the process to VarEndProcXXXX (keep the names matching). While it won't give the direct change you at least can build something searchable. If you use labels in your code for the variables it would be even more useful.
I will say that seeing that many name changes makes me a bit concerned about the overal process, most likely the data import. But I may be picky about the start of things.