SAS® macro tool to find source data sets used in programs


There are times when programmers need to know the source of the data sets used in a program. This macro, designed by Prasanna Murugesan and Sushant Thakare from Quintiles Inc., will help you extract the lib names from various programs and put them in an Excel file.

According to Murugesan, the paper’s presenter at MidWest SAS Users Group Conference in Minneapolis MN, this macro is useful in two very important areas:

  • Documentation – Traditionally we manually search for the source data sets. This is very time-consuming.
  • Program dependency – For the purposes of his presentation (and because of the industry that Murugesan and Thakare work within) the example that Murugesan gave relates to the pharmaceutical industry.

“What I mean by program dependency is, we have different levels of programming in the pharma industry:

  • We have the raw data sets, which we convert to the SDTM data sets Level 1;
  • At Level 2, we convert the SDTM data sets to ADaM data sets;
  • And, at Level 3, we convert these ADaM data sets to tables, listings and figures.”

According to Murugesan, the benefits of the macro is really felt when he has a small study to run and doesn’t want to run all of the data. He can run the macro to find the source data sets and run only the derived data sets that are required for tables, listings and figures for the requested delivery.

“It’s just a fast and friendly program to find the source data sets,” said Murugesan. “We wanted to achieve minimum user interface here, so you don’t even have to open a SAS session to run it …. It’s just a basic macro search tool, so you can customize it in whatever way you want it.”

For step-by-step directions and sample code, download the paper from


About Author

Waynette Tubbs

Editor, Marketing Editorial

+Waynette Tubbs is the Editor of the Risk Management Knowledge Exchange at SAS, Managing Editor of sascom Magazine and Editor of the SAS Tech Report. Tubbs has developed a comprehensive portfolio of strategic business and marketing communications during her career spanning 15 years of magazine, marketing and agency work.

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to Top