BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
shiney_martin1
Fluorite | Level 6

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.

1 ACCEPTED SOLUTION

Accepted Solutions
shiney_martin1
Fluorite | Level 6

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?

View solution in original post

6 REPLIES 6
yabwon
Onyx | Level 15

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

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



shiney_martin1
Fluorite | Level 6

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.

shiney_martin1
Fluorite | Level 6

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?

yabwon
Onyx | Level 15

Leave it, for others to learn.

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



ballardw
Super User

Leave the question and solution in the forum in case others have a similar issue.

yabwon
Onyx | Level 15

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

 

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Discussion stats
  • 6 replies
  • 560 views
  • 6 likes
  • 3 in conversation