The SAS Output Delivery System and reporting techniques

Listing the sas program based on library they are calling

Reply
Frequent Contributor
Posts: 88

Listing the sas program based on library they are calling

Hi Everyone,

I have one question like we can list out the sas dataset their location and as well as library using SAS dictionary object, but would it possible to list all program which are calling perticular library? Like suppose i have library TEST in which 10 dataset is there, so can i get list of .sas file in which my dataset present in that libary is getting called? Also same about autocall library for macro, can we list all .sas program based on the autocall library ? imean if we just have a library name? Please Assist me for the same. Thanks in Advanced.

Regards,

Tushar Jagtap.

Esteemed Advisor
Posts: 5,198

Re: Listing the sas program based on library they are calling

If you are using Base to create those .sas files, there are no out-of-the-box tool in SAS for this. One SAS tool that can get you half way is the SAS code analyzer.

Basic OS tools may help, such as grep (UNIX) and FindStr (Windows).

You could if you like create some SAS program that reads through all SAS-programs.

Either way, it could be quite complex. If your lucky you can find some sample on the Internet.

Data never sleeps
Frequent Contributor
Posts: 88

Re: Listing the sas program based on library they are calling

Thanks LinusH for your quick reply.

Basically as per my requirement i found this similar functionality in SAS DI that is what we called Impact Analysis. So basically what i was doing to implement the same using BASE SAS Code. but its look like i need to write some SAS-Unix wrapper programming. Initially i had the same thought in my mind using some OS specific functionality. Then i thought before implement lets throw this discussion on SAS community portal, looking for wether any Proc present in Base SAS for implementing kind of funcitonality. Anyway Thanks a lot again. Smiley Happy

Regrads,

Tushar J.

Esteemed Advisor
Posts: 5,198

Re: Listing the sas program based on library they are calling

If your SAS programs are running in batch, consider to import them to DI Studio, and then you could make use of the Analyze capabilities there (for this, the SAS Code Importer usually works fine).

Data never sleeps
Frequent Contributor
Posts: 88

Re: Listing the sas program based on library they are calling

Thanks LinusH,

I will try that option too...

Regards,

Tushar J

Occasional Contributor
Posts: 8

Re: Listing the sas program based on library they are calling

Hi,

you can make use of dopen, dnum & dread functions if you do not want use OS commands

Frequent Contributor
Posts: 88

Re: Listing the sas program based on library they are calling

Hey Amarnath7,

Thanks for your suggestion. I will try to implement that option too.

Regards,

Tushar J

Ask a Question
Discussion stats
  • 6 replies
  • 525 views
  • 3 likes
  • 3 in conversation