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.

1 REPLY 1
Mike_Drutar
SAS Employee

Hello Stacey!

 

One quick way to get a lot of information on a sas dataset (and more importantly the columns within the data) is to use PROC CONTENTS.

 

Most programmers know they can use proc contents to get information about the columns in a single SAS dataset.  Here's an example of using the sashelp.class data.

proc contents data=sashelp.class; run;

 

However PROC CONTENTS can also be run against an entire library; returning information about all datasets, and all columns within the datasets.  Here's an example using the sashelp library:

 

proc contents data=sashelp._ALL_ out=work.datainfo; run;

 

The _ALL_ option makes the procedure read all sas datasets in the library.

The out= option writes the information out to a sas dataset (work.datainfo) for future use.

 

You might consider using the work.datainfo data as the source for your visualization. 

 

- Mike Drutar

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 837 views
  • 0 likes
  • 2 in conversation