PROC FedSQL or PROC DS2 might produce errors similar to the following when you assign multiple LIBNAME connections to a database that supports native catalogs:
ERROR: Duplicate catalog name, <name>, encountered in connection string, DSN or file DSN
Native catalogs are automatically included in the database connection and are not listed in the CATALOG= parameters. To circumvent the errors, you need to specify all additional native catalog entries in the connection string, and you need to rename any entries that produce errors.
For example, the following Netezza server has two native catalogs named MODEL and SYSTEM. An error similar to the following occurs for each
duplicate catalog name found:
ERROR: Duplicate catalog name, MODEL, encountered in connection string, DSN or file DSN
ERROR: Duplicate catalog name, SYSTEM, encountered in connection string, DSN or file DSN
The example below shows how you can rename the two catalog names to circumvent the errors.
To write the connection strings for all of the LIBNAMES currently assigned in the SAS® session to the SAS log, add this option before the PROC DS2 or PROC FedSQL statement:
options msglevel=i;
proc fedsql;
quit;
The connection strings below illustrate how to rename the catalog names to circumvent the errors caused by duplicate names.
proc fedsql nolibs conn="DRIVER=FEDSQL;CONOPTS=(
(DRIVER=NETEZZA;SERVER=daily;DATABASE=TEST;UID=net_test;PWD=*;CATALOG=(X1=TEST;X1_MODEL=MODEL;X1_SYSTEM=SYSTEM;));
(DRIVER=NETEZZA;SERVER=daily;DATABASE=system;UID=net_test;PWD=*;CATALOG=(X2=TEST2;X2_MODEL=MODEL;X2_SYSTEM=SYSTEM;));)";
select * from X1.customer;
quit;
To prevent the connection strings from being written to the SAS log, add this option:
options msglevel=n;
Another workaround for the problem is to specify the schema (such as dbo and abc) in the table name as shown here:
libname s sqlsvr dsn=my_dsn; user=my_user; pw=my_pw;
proc fedsql;
create table s.dbo.table1 ("x" INTEGER);
create table s.abc.table2 ("y" INTEGER);
quit;
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.