0

In SAS 9.2, how do I get the return codes / error messages from explicit pass-through sql to teradata? Printed in log or output or something.

I already got a small query to work fine, but having some trouble with a more complex one. Debugging would be much easier with the error messages. Tried the sqlxmsg and sqlxrc that are used when querying db2, but of course those don't work... haven't found any documentation on this. (I'm quite new to Teradata)

Joe
  • 62,789
  • 6
  • 49
  • 67
jonnaA
  • 9
  • 2
  • I thought sqlxmsg and sqlxrc should work with Teradata. What code did you use? – DWal Feb 26 '15 at 15:21
  • The documentation doesn't say they don't work, but who knows. 9.2 is fairly early for Teradata support; 9.4 has much stronger support, so it's possible some things just aren't implemented there. If you don't get a good answer here, I would ask on communities.sas.com or even (if you're in a bit of a hurry) put in a ticket with SAS support. – Joe Feb 26 '15 at 15:23
  • Does `SASTRACE` http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a000433982.htm help in this context? – mjsqu Feb 26 '15 at 20:12
  • I thought SASTRACE was only to show you the statements actually sent when using implicit pass-through rather than explicit pass-through? – Joe Feb 26 '15 at 20:34
  • See answer, I _knew_ I'd used it in explicit pass-through before! – mjsqu Feb 26 '15 at 21:27
  • It works for printing the messages, but it's not clear why you'd want to also reprint the query which would just be the same thing as what you wrote using explicit pass-through. – DWal Feb 26 '15 at 21:34

2 Answers2

0

Use the SASTRACE option to bring back debugging messages from Teradata.

http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a000433982.htm

This document supports and shows an example of it in use on explicit pass-through SQL:

https://support.sas.com/resources/papers/TroubleshootingSASandTeradataQueryPerformanceProblems.pdf

N.B. If you are using this option on large sets of data, be careful to choose the options wisely or you will create huge logs

mjsqu
  • 5,151
  • 1
  • 17
  • 21
-1

This was the code, and now after shutting and restarting SAS it works fine! Seems I had some process hanging somewhere...

rsubmit sashost;
proc sql;
connect to teradata (user=&terauser password=&terapass server=&teraserv mode=teradata); 
create table test as
select * from connection to teradata
(select x
from y.z
where c);
%put &sqlxmsg;
%put &sqlxrc;
disconnect from teradata;
quit;
proc download data=test out=locallib.test; run;
endrsubmit;
jonnaA
  • 9
  • 2
  • Did `&sqlxmsg` and `&sqlxrc` work in this context? The question after all is about the return codes, not the actual table creation. – Joe Feb 26 '15 at 16:21