BookmarkSubscribeRSS Feed
StaceyB
Obsidian | Level 7

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.

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

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! 🙂

ballardw
Super User

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 698 views
  • 0 likes
  • 3 in conversation