Hi,
I'm executing a MS SQL Stored Procedure from SAS DI Studio like this:
PROC SQL ;
CONNECT TO odbc (&_OUTPUT1_connect.) ;
EXECUTE (TheStoredProcedure) BY odbc ;
DISCONNECT FROM odbc ;
QUIT ;
However the Stored Procedure contains print messages like:
PRINT 'Rows inserted: ' + CAST(@rowsInsertedHD AS VARCHAR(100))
And those messages are come back as warnings in SAS.
Is there any way to suppress those warnings, without altering the Stored Procedure?
What happens if you use: proc sql nowarn;
Note to stored procedure developer: Any printed output should be optional and turned off by default - program design 101.
Still getting warnings
What's the issue for you? The warnings triggering a non-zero return code on the job or something else?
What scheduler do you use? You might be able to tweak the batch script file to ignore warnings in this case. You could also open a track with SAS Tech Support to see if they have any other ideas.
I'm assuming here there is no possibility of getting the stored procedure changed as that would be the best option.
@ThierryHerrie - No problem! Please mark your solution as answered in that case.
Hi,
I facing same issue while executing, Can you provide the answer you figured out for solution.
Hope that can help in resolving my issue.
Thanks,
Ashna
Hi Ashna,
I created a job in SQL Server, using SQL Server Management Studio. The job executes the SQL Stored Procedure.
From SAS I execute the SQL Server job. That way I don't get a warning in the SAS log.
Kind regards,
Thierry
Thanks ll try and check if that helps me out
Hi Theirry,
Could you please share sas code, where you are calling sql stored procedure from SAS EG. I'm facing same issue you faced earlier. Thanks.
@k75240 - The code is in the first post.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.