- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi. I'm having several Stored Procedures that I use to update/create tables that users can correct numbers and add lines. When I create the I just want to make a screen saying that the data set has been updated. I can get when the dataset information as dates, path, observations in the printed output from proc contents. However I have not found a way to get this in a dataset so I can test the date against current clock time and make a nice message saying updated successfully. The out statement only give the variables.
Does anybody have a nice trick for this?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Just to show how this works in practice:
proc sql;
create table class as select * from sashelp.class;
select modate
from dictionary.tables
where libname = 'WORK'
and memname = 'CLASS';
quit;
%let wait=%sysfunc(sleep(1,1));
proc sql;
create table class as select * from sashelp.class;
select modate
from dictionary.tables
where libname = 'WORK'
and memname = 'CLASS';
quit;
Result:
Date Modified ---------------- 06JUN19:10:22:35 Date Modified ---------------- 06JUN19:10:22:36
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
proc sql noprint;
create table updated as
select *
from dictionary.tables
where libname = 'SASHELP'
and memname = 'CLASS' ;
quit;
Column modate will contain a datetime value showing the date and time the table was modified.
Note remember that libname is always in upper case in dictionary and that memname is in mixed case, you may want to surround both memname and your tablename with the upcase function to ensure a match.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, works like a dream
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Just to show how this works in practice:
proc sql;
create table class as select * from sashelp.class;
select modate
from dictionary.tables
where libname = 'WORK'
and memname = 'CLASS';
quit;
%let wait=%sysfunc(sleep(1,1));
proc sql;
create table class as select * from sashelp.class;
select modate
from dictionary.tables
where libname = 'WORK'
and memname = 'CLASS';
quit;
Result:
Date Modified ---------------- 06JUN19:10:22:35 Date Modified ---------------- 06JUN19:10:22:36
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a million. I did not think about dictonary.tables. Shame on me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
How to get created date/time?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It is also in DICTIONARY.TABLES, right next to MODATE.