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

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!

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
  • 826 views
  • 0 likes
  • 2 in conversation