BookmarkSubscribeRSS Feed
KevinViel
Pyrite | Level 9

This probably falls into the category of "no" or petition SI.  Does SAS have an option to report whether a data step or procedured read from a (permanent) data set?

 

323 proc sql ;

324 select count( * )

325 from sdtm.dm

326 ;

327 quit ;

NOTE: PROCEDURE SQL used (Total process time):

real time 0.00 seconds

cpu time 0.00 seconds

 

328

329 data _null_ ;

330 set sdtm.dm nobs = nobs ;

331 put nobs= ;

332 stop ;

333 run ;

nobs=43

NOTE: There were 1 observations read from the data set SDTM.DM.

NOTE: DATA statement used (Total process time):

real time 0.00 seconds

cpu time 0.00 seconds

 

334

335 data _null_ ;

336 if 0 then set sdtm.dm nobs = nobs ;

337 put nobs= ;

338 stop ;

339 run ;

nobs=43

NOTE: DATA statement used (Total process time):

real time 0.00 seconds

cpu time 0.00 seconds

 

I see no fool proof method of parsing the log to obtain such information unless the NOTE reports it.  Users can use macros and macro variables.

 

I would like to have my programmers report all data sets and files used by a program, but they are not consistent.  Since I perfrom a log check, I thought I would just glean this information from the log, but the SQL procedure and the case when the program uses the metadata but does not read an observation are problematic.  Procedures like MIXED do not seem to report the data set used to the log, but rather to the PRINT destination, which is of no use if the LISTING destination is closed.

 

Thank you,

 

Kevin

2 REPLIES 2
Reeza
Super User

Use PROC SCAPROC to output a trace of the programs, if all programmers use this the output is standardized and you can write custom scripts to parse the output to your hearts desire. 

 

Plus here's some code to get you started in parsing the output:

http://support.sas.com/kb/58/047.html

 

 

 

 

Patrick
Opal | Level 21

I don't believe there is any fool proof method to achieve what you're after using SAS logs. Example: If you access a view then best you get in the log is the name of the view but not which tables the view accessed.

 

You could use some OS monitoring tool to collect stats which .sas7bdat files get accessed how often

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 528 views
  • 0 likes
  • 3 in conversation