I am trying to extract some data from Teradata but before executing code I would like to test server connection.
I want to execute code only when server is up.
Is there any SAS statement/function that can be used to test server connection in batch mode.
How are you connecting to the server?
The LIBNAME statement will set the macro varaible SYSLIBRC which you can then check.
libname td teradata ..... ;
%if (&syslibrc) %then %do;
%put ERROR: Could not connect to Teradata ;
%end;
%else %do;
... run extract code ...
%end;
How are you connecting to the server?
The LIBNAME statement will set the macro varaible SYSLIBRC which you can then check.
libname td teradata ..... ;
%if (&syslibrc) %then %do;
%put ERROR: Could not connect to Teradata ;
%end;
%else %do;
... run extract code ...
%end;
PROC SQL;
CONNECT TO TERADATA(DATABASE=<dbname> USER=<user> PASSWORD=<pwd>);
CREATE TABLE temp AS
SELECT * FROM CONNECTION TO TERADATA
(SELECT * from <table_name>
sample 0
) ;
DISCONNECT FROM TERADATA;
QUIT;
Try this if you are using SQL Pass through to teradata
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.