DATA Step, Macro, Functions and more

Find all programs that use a certain libname

Reply
Regular Contributor
Posts: 222

Find all programs that use a certain libname

Hi experts.

 

Do you guys have any idea, on how to find all programs that use a certain libname ?

This should look for it in all folders and paths.

 

To be more specific, maybe use shell commands to do this, but my idea is to put libname's names in a macro

and do this multiple times for every libname in our server.

 

Maybe create a list with libname and programs beside.

 

Do you guys have any idea how to do this ?

 

Thanks in Advance

Super User
Super User
Posts: 9,427

Re: Find all programs that use a certain libname

Posted in reply to DartibaliRodrigo

Which OS are you using?  If Windows then:

findstr /n /i /c:"abc" *

Assuming abc is the libname.  Other searches here:

https://www.computerhope.com/findstr.htm

 

However that being said, the question here is why.  You should have one of the following:

A fixed set of libnames started at the session

A fixed structure which all code performs to

Documentation on programs which do not conform to a structure

 

So the question is why you need to go through this process, as a) it will take a lot of time, not just getting the list, but parsing it and checking for all potentials, but b) might not even be right, I mean you could have other references, filerefs etc. setup for this.

Regular Contributor
Posts: 222

Re: Find all programs that use a certain libname

I'm using batch shell (Unix).

Super User
Posts: 5,852

Re: Find all programs that use a certain libname

Posted in reply to DartibaliRodrigo

Simple answer, you can't.

A SAS program can be stored anywhere, and it could be submitted from anywhere within your environment restrictions (which usually could still be quite vast).

Agree with @RW9, why? Lineage I presume.

You can do Lineage with any stuff stuff that is aligned with your system architectural, design and documentation (meta data etc). All other programs should not be of the system owners concern.

Data never sleeps
Super User
Super User
Posts: 9,427

Re: Find all programs that use a certain libname

Posted in reply to DartibaliRodrigo
Ask a Question
Discussion stats
  • 4 replies
  • 115 views
  • 2 likes
  • 3 in conversation