BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ScottBass
Rhodochrosite | Level 12

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:

 

http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#p11nt7mv7k9hl4n1x...

http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#p1kxial1o2r732n1k3...

 

IMO this doc is a bit "generic" as to when SAS sets &syscc to non-zero.

 

This link is also relevant (ERRORCHECK option)

 

http://support.sas.com/documentation/cdl/en/lesysoptsref/69799/HTML/default/viewer.htm#n074sx2hkq8dz...

 

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.


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20
From the documentation I would suspect that at least when ERRORCHECK=STRICT is set, syscc should not be zero. So a clarification from SAS Tech support would might be in place.
Data never sleeps

View solution in original post

2 REPLIES 2
LinusH
Tourmaline | Level 20
From the documentation I would suspect that at least when ERRORCHECK=STRICT is set, syscc should not be zero. So a clarification from SAS Tech support would might be in place.
Data never sleeps
Kurt_Bremser
Super User

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.

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 873 views
  • 1 like
  • 3 in conversation