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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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