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

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 606 views
  • 0 likes
  • 4 in conversation