DATA Step, Macro, Functions and more

Question on reading SAS logs into a SAS dataset specifically to list the datasets used.

Reply
Occasional Contributor
Posts: 9

Question on reading SAS logs into a SAS dataset specifically to list the datasets used.

Hi,

 

Before I start coding, I was wondering if any users have any existing code / macros that can read a SAS log, and list the input datasets that are used by that code? The logs exist as individual text files, but the reading and looping round is all fine, I'm after any logic / code that can extract the names of the input datasets from data steps, procs and sql statements etc.

 

Thanks!

Super User
Super User
Posts: 7,997

Re: Question on reading SAS logs into a SAS dataset specifically to list the datasets used.

I would imagine a lot of us have log check programs, however these are proprietary to our jobs.  Reading and extracting things from the log is not quite as straight forward as you think it is.  Does you code contain macros or other generated code?  What about modifications to files outside datasteps.  Several connotations.  I would question why you need to do this in the first place, is it for some kind of validation effort (which is what these types of questions come up as), if so then I would say you working from the wrong end.  A properly validated (or QC'd) system/process, can only be achieved by planning up front, documenting, then develpoment and testing.  Doing things the other way round doesn't actually prove anything at all other than something actually happens.

Occasional Contributor
Posts: 9

Re: Question on reading SAS logs into a SAS dataset specifically to list the datasets used.

Couldn't agree more on the importance of good design! Sadly, as is often the case, we're working with what we have. Appreciate the reply.
Super User
Posts: 19,877

Re: Question on reading SAS logs into a SAS dataset specifically to list the datasets used.

Search for log parsers on lexjansen.com 

Super User
Posts: 5,441

Re: Question on reading SAS logs into a SAS dataset specifically to list the datasets used.

PROC SCAPROC.

Data never sleeps
Ask a Question
Discussion stats
  • 4 replies
  • 228 views
  • 3 likes
  • 4 in conversation