BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

I am running via SAS code to check when a table was created (And when was updated ).

This table is located in  TeraData.

What is the reason that I see No information on this information

proc contents data=tcrmseg.gal_hravot_brzel_2023;Run;

/**Other Way**/
proc datasets library=TCRMSEG;
contents data=gal_hravot_brzel_2023;
run;

 

Ronein_0-1700123807921.png

 

5 REPLIES 5
Ronein
Meteorite | Level 14

So you recommend query it inside Tera and not in SAS?

Quentin
Super User

After figuring out how to query the metadata in teradata, and getting that query working, then you can come back to SAS.

 

SAS Explicit pass-through SQL allows you to use SAS, but write native teradata SQL code that SAS will send to teradata for execution, and then return results to SAS.  See for example https://www.lexjansen.com/sesug/2017/DM-57.pdf

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
SASKiwi
PROC Star

@Ronein - First you will need to define what you mean by "last updated". Does that mean the last time rows were updated, inserted, or deleted or all three? If you Google the question then you will get answers like this: https://stackoverflow.com/questions/58404933/teradata-how-to-find-when-was-table-last-updated-not-al...

 

Once you are happy with the Teradata query, you can wrap it inside a SAS PROC SQL step:

libname teradata teradata noprompt = "<Teradata connection string>";

proc sql;
 connect using teradata;
  create table Want as 
  select * from connection to teradata
  (<-Put your Teradata query here->)
  ;
quit;

 

 

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
  • 5 replies
  • 1090 views
  • 0 likes
  • 4 in conversation