Hello!
I have a SAS dataset with a composite index. I'm running a SAS procedure (StdRate) over it many times, and I'm looking to suppress information being written to the log so that it doesn't fill it up and pause. I have noNotes, noSource, and msgLevel = i, and that gets rid of everything except the list of variables that make up the index being used.
Here is the log for one call without anything suppressed:
38 proc stdRate data = analysis.nSummarizeT (where = (<snipped>)
39 refData = analysis.qUSCensusFormatted (where = (<snipped>)
40 method = direct stat = rate(mult = 100000) effect = ratio
41 alpha = 0.05 CL = gamma(type = average)
42 plots = all;
INFO: Index unique1 selected for WHERE clause optimization.
43 by levelN level groupN group exposureTypeN exposureType _type_ consentFirst remove;
44
45 population group = exposureHigh event = events total = personYears;
46 reference total = population;
47 strata gender ageGroup / effect stats(cl = poisson) order = data;
INFO: Use of index unique1 for WHERE clause optimization canceled.
INFO: Index index selected for WHERE clause optimization.
INFO: Index index selected for BY clause processing.
NOTE: An index was selected to execute the BY statement.
The observations will be returned in index order rather than in physical order. The selected index is for the variable(s):
levelN
level
groupN
group
exposureTypeN
exposureType
_type_
consentFirst
remove
48 ods output StdRate = ___StdRate (compress = no) Effect = ___Effect (compress = no);
49 run;
NOTE: The data set WORK.___EFFECT has 1 observations and 19 variables.
NOTE: The data set WORK.___STDRATE has 2 observations and 21 variables.
NOTE: PROCEDURE STDRATE used (Total process time):
real time 0.63 seconds
user cpu time 0.14 seconds
system cpu time 0.17 seconds
memory 11344.90k
OS Memory 86928.00k
Timestamp 02/09/2021 09:40:35 PM
Step Count 9281 Switch Count 0
Here is the log for several calls with noNotes, noSource, and msgLevel = i:
levelN
level
groupN
group
exposureTypeN
exposureType
_type_
consentFirst
remove
levelN
level
groupN
group
exposureTypeN
exposureType
_type_
consentFirst
remove
levelN
level
groupN
group
exposureTypeN
exposureType
_type_
<etc.>
Is there any way to prevent SAS from printing these index variables?
Warm regards, 🙂
Michael
> Is there any way to prevent SAS from printing these index variables?
This does it:
filename LOGFILE temp;
proc printto log=LOGFILE; run;
proc print; by I; run;
proc printto log=log; run;
options msglevel=N should suppress printing detailed index related information, note that 'N' value of this options is default.
It suppresses notes that begin with INFO:, but it does not, sadly, suppress the index variables being listed out. I edited my post to include that.
To replicate:
data t(index=(I)); I=1; run;
options nonotes ;
proc print; by I; run;
This looks like an "omission" (aka a defect), and there is no reason this message should appear in the log imho, even if it's not a NOTE per se.
I'd report it to SAS Tech support.
> Is there any way to prevent SAS from printing these index variables?
This does it:
filename LOGFILE temp;
proc printto log=LOGFILE; run;
proc print; by I; run;
proc printto log=log; run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.