Error messages like the following might be generated when the SCHEMA= option is used in a LIBNAME statement to create a Teradata table from PROC DS2:
ERROR: Base table or view not found Object 'DUMMY2' does not exist.
ERROR: Unable to add rows to table.
ERROR: General error
To circumvent the problem, use the DATABASE= option instead of SCHEMA= option in the LIBNAME statement.
The following sample code illustrates the problem. You will need to specify the correct values for your site for the options in the LIBNAME statement.
libname dd1 teradata user="TEST_BATCH" password=XXXXXXXXXX tdpid="IDW" logdb=ABC_SAS schema=xyz_dwa;
proc ds2;
data dd1.dummy3(overwrite = yes);
method init();
end;
method run();
set shoes;
end;
method term();
end;
enddata;
run;
quit;
Be aware that while the DATABASE= and SCHEMA= options are related, they do function differently. The DATABASE= option issues a DATABASE command, potentially altering the default database for your connection. In contrast, the SCHEMA= option alters the SQL that is submitted, prefacing table names with the SCHEMA= value. Therefore, SAS issues the following without the SCHEMA= option:
SELECT * FROM TAB
With SCHEMA=OTHERDB specified, SAS issues the following:
SELECT * FROM OTHERDB.TAB"