BookmarkSubscribeRSS Feed
deleted_user
Not applicable
HI

i have a master table (master_uniq) consitnously we will updaate dataset to that table (50-120 datasets/perday).Now i want the last updated dataset.i have tryed dictionary.vtable also.please let me know
4 REPLIES 4
deleted_user
Not applicable
Hi,

You can find this using proc contents.

You will have a variable called MODATE which gives you last modified date

check with this.

Hope this will help you
DanielSantos
Barite | Level 11
Are you looking ofr the last updated dataset or the last dataset that updated the master table?

For the first, PROC CONTENTS/MODADTE would be a good solution.
You could try also the SYSLAST macro variable which stores the name of the last written dataset.

For the last, you could try to arrange your code to save the desired name on some macro variable, for later processing.

Cheers from Portugal.

Daniel Santos @ www.cgd.pt
deleted_user
Not applicable
Hi,

You can use the following logic to get the last modified date of a file:

filename inp pipe "ls -g -o ~/&FileName1";
data _null_;
infile inp firstobs=2;
input @24 ModifiedDate $12. ;
if ModifiedDate=" " then stop;
put ModifiedDate= ;
run;

U can pass the list of all files one by one and record the one with the maximum modified date.
Above code is for UNIX,
for windows use: filename inf pipe "dir &FileName1 /t:w /a:-d"; and read from the 6th observation
in format mmddyy8. and time8.
Peter_C
Rhodochrosite | Level 12
if you update the "master" with PROC APPEND or data step MODIFY, let an AUDIT trail keep the "knowledge".

good luck
PeterC

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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