I am running the following code to subset an existing table as part of a data engineering pipeline. I want to reduce outputs to the log from proc cas.
proc cas ;
table.Partition/ casout={caslib="mycaslib" name="previous_errors" replace=True}
table={caslib="mycaslib" name= "&viewName._DQ" where="DQField= error"};
quit;
This will then print to the log the following:
{caslib=mycaslib,tableName=PREVIOUS_ERRORS,rowsTransferred=0,shuffleWaitTime=0.000010252,minShuffleWaitTime=0,maxShuffleWaitTime=2.1457672E-6,averageShuffleWaitTime=1.4645713E-6}
This is very frustrating as this code is part of a macro running close to 100 times, so this message is really unnecessarily clogging up the log.
Does anyone know how to turn it off?
I already have messageLevel set to "warning", which I have checked using "listsessopts"
I am using SAS Viya 3.5.
Apologies everyone, I have resolved my own issue!
If you add in a results=r option, it will store the results in a file called "r" instead of printing to the log.
proc cas ;
table.Partition result=r/ casout={caslib="mycaslib" name="previous_errors" replace=True}
table={caslib="mycaslib" name= "&viewName._DQ" where="DQField= error"};
quit;
Pretty new to this forum.. should I delete my post or leave it up as could be useful to others?
You could try the "proc printto + dummy file" sandwich:
filename D dummy;
proc printto log=D;
run;
proc cas ;
table.Partition/ casout={caslib="mycaslib" name="previous_errors" replace=True}
table={caslib="mycaslib" name= "&viewName._DQ" where="DQField= error"};
quit;
proc printto;
run;
filename D clear;
Bart
Hi @yabwon, thanks for that, this does work.
However, then if there were any errors or warnings in this step, I would not see them in the log, so it's not quite the ideal solution. If there is any way to do it while using the main log?
It seems odd as most other parts of SAS have ways of suppressing things being printed to the log.
Apologies everyone, I have resolved my own issue!
If you add in a results=r option, it will store the results in a file called "r" instead of printing to the log.
proc cas ;
table.Partition result=r/ casout={caslib="mycaslib" name="previous_errors" replace=True}
table={caslib="mycaslib" name= "&viewName._DQ" where="DQField= error"};
quit;
Pretty new to this forum.. should I delete my post or leave it up as could be useful to others?
Leave it, for others to learn.
Leave the question and solution in the forum in case others have a similar issue.
Just if you need it for other situations:
filename D temp;
proc printto log=D;
run;
proc cas ;
table.Partition/ casout={caslib="mycaslib" name="previous_errors" replace=True}
table={caslib="mycaslib" name= "&viewName._DQ" where="DQField= error"};
quit;
proc printto;
run;
data _null_;
infile D;
input;
if "ERROR:"=:_infile_ or
"WARNING:"=:_infile_
then put _infile_;
run;
filename D clear;
There is also SYSERR macrovariable which keep info about last error.
Bart
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.