BookmarkSubscribeRSS Feed
deepakkailay
Calcite | Level 5

Hi,

 

I am using libname to create temp table and using it with proc sql to access it.

I am able to run the code on SAS EG but it is hitting the error on UNIX that Teradata prepare: Object 'migrated_201401' does not exist. 

 


%let tag_value=migrated_201401;
options sastrace=',,,d' sastraceloc=saslog;


libname mytd teradata user=&user. password=&password. tdpid=edwprod connection=global dbmstemp=yes mode=teradata dbcommit=0;

proc delete data=mytd.&tag_value.; run;

proc append data = only_cl_tids_migrated base = mytd.&tag_value. (tpt=no dbcommit=5000) force; run;

 

proc sql;
reset INOBS = max OUTOBS = max LOOPS = MAX NOFLOW NOFEEDBACK NOPROMPT NONUMBER;
connect to teradata(tdpid = edwprod database = consumer user =&user. password=&password. connection=global);
create table test as
select * from connection to teradata
(
select a.*,
b.*

from &tag_value. a
join tag_tbl b /* table present on my teradata system*/
on a.acct= b.acct
);
quit;

ERROR: Teradata prepare: Object 'migrated_201401' does not exist. SQL statement was:

Please provide some guidance.

 

thanks in advance.

4 REPLIES 4
kiranv_
Rhodochrosite | Level 12

i think you are not referencing Teradata database name and your just mentioning table name and hence it is looking for a volatile table(kind of work table in SAS). You need to have proper database name in front of &tag_value, something like yourdatabase..&tag_value.

deepakkailay
Calcite | Level 5

Thanks for the reply, actually I am creating the this tag table with proc append by using library(bridge with teradata). 

there is no need to use libname here. same code is working fine on SAS EG but it is not working on UNIX.

Tom
Super User Tom
Super User

You need to show more of the log.

Did the PROC APPEND step really create the table in Teradata?

Are your connection strings between your LIBNAME and CONNECT statement actually the same? If not then SAS will make a NEW connection to Teradata and not be able to see the temporary table.

Are you using a different account in Teradata between the two different runs? Perhaps they have different permissions in Teradata.

deepakkailay
Calcite | Level 5

HI,

 

Thanks for your help. I just added database= options with libname and specified the database that I am using below with the proc sql. it worked fine.

 

Thanks

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 5987 views
  • 0 likes
  • 3 in conversation