SAS 9.03.01M2P081512 on Windows
EG 6.1M1
Before I enter a TS track, I thought I'd check here first in case I'm missing something.
I checked the doc here and here:
IMO this doc is a bit "generic" as to when SAS sets &syscc to non-zero.
This link is also relevant (ERRORCHECK option)
I'm allocating two librefs to SQL Server (this is output from a macro);
=================================================================================
LIBREF: CONTENT
CONNECT: NOPROMPT="Driver={SQL Server Native Client 10.0};Server=XXXXXXXX;Database=XXXXX;Trusted_Connection=yes;"
OPTIONS: bulkload=yes schema=content
=================================================================================
=================================================================================
LIBREF: TMP
CONNECT: NOPROMPT="Driver={SQL Server Native Client 10.0};Server=XXXXXXXX;Database=XXXXX;Trusted_Connection=yes;"
OPTIONS: bulkload=yes schema=tmp
=================================================================================
I submitted this code, which contains an error (mismatch between connect using and by):
proc sql;
connect using content;
execute(
SELECT * FROM INFORMATION_SCHEMA.Tables /* not my real query */
) by tmp;
quit;
ERROR: The TMP engine cannot be found.
ERROR: A Connection to the tmp DBMS is not currently supported, or is not installed at your site.
I tried this using both errorcheck=normal | strict, with the same result, &syscc remains zero.
I'm capturing the final &syscc in an audit table, so this result is misleading/incorrect.
Shouldn't SAS set &syscc to non-zero in this scenario? If this is returning 0 as a return code to the O/S (i.e. %ERRORLEVEL%=0), this could be bad for scheduled jobs with upstream dependencies.
Concur with @LinusH. As the ERROR clearly happens in the SAS context (and not in the remote execute), it should have influence on the overall return code, especially when run in batch. And there should at least be an option to "catch" errors that happen in the execute, if that does not happen already.
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.
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.