BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
IgawaKei29
Quartz | Level 8

I am having an issue where I am trying to create a volatile table using SAS, then being able to connect and review this table.  Ultimately I am trying to join a Teradata Volatile table with Hadoop data, but I figure this is the first step.  You can see a sample layout of my code below, and the only error I get when running is that my_VTD_Test doesn't exist, which is true at the start of the program. Everything else completes just fine, but when I try to look at the table data, I get an error that it doesn't exist again. So it looks like its running but not gathering any data. I appreciate any feedback with this.

 

 
libname tdwork teradata AUTHDOMAIN=MYAUTH 
    mode=teradata  server="myserver" 
    connection=global dbmstemp=yes;


PROC SQL NOERRORSTOP;
CONNECT TO TERADATA (AUTHDOMAIN=TDAUTH  server="myserver" connection=global mode=teradata);
  execute (drop table my_VTD_Test) BY Teradata;
  execute( create volatile table my_VTD_Test as
  		  (select Name, Place, Service

from MYTDSCHEMA.Table_NAME
		
			

 )
		with data primary index(Name) On Commit Preserve Rows ) by teradata; 
		
				DISCONNECT FROM teradata;
quit;
 
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

First thing I would do is not make two connections to Teradata.  Then you don't have to worry about whether or not SAS will make two different connections to Teradata.  Just re-use the TDWORK connection you made with the LIBNAME statement in your PROC SQL code.

libname tdwork teradata AUTHDOMAIN=MYAUTH 
    mode=teradata  server="myserver" 
    connection=global dbmstemp=yes
;

PROC SQL NOERRORSTOP;
CONNECT USING TDWORK as TERADATA;
EXECUTE BY TERADATA (drop table my_VTD_Test);
EXECUTE BY TERADATA 
( create volatile table my_VTD_Test as
  (select Name, Place, Service
   from MYTDSCHEMA.Table_NAME
  ) with data primary index(Name) On Commit Preserve Rows 
);
quit;

You might also need to set the schema in your LIBNAME statement.  I seem to remember that it uses your teradata username as the schema name for the volatile tables.

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

First thing I would do is not make two connections to Teradata.  Then you don't have to worry about whether or not SAS will make two different connections to Teradata.  Just re-use the TDWORK connection you made with the LIBNAME statement in your PROC SQL code.

libname tdwork teradata AUTHDOMAIN=MYAUTH 
    mode=teradata  server="myserver" 
    connection=global dbmstemp=yes
;

PROC SQL NOERRORSTOP;
CONNECT USING TDWORK as TERADATA;
EXECUTE BY TERADATA (drop table my_VTD_Test);
EXECUTE BY TERADATA 
( create volatile table my_VTD_Test as
  (select Name, Place, Service
   from MYTDSCHEMA.Table_NAME
  ) with data primary index(Name) On Commit Preserve Rows 
);
quit;

You might also need to set the schema in your LIBNAME statement.  I seem to remember that it uses your teradata username as the schema name for the volatile tables.

IgawaKei29
Quartz | Level 8
Thank you, this really helped!

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2 replies
  • 510 views
  • 1 like
  • 2 in conversation