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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1946 views
  • 0 likes
  • 3 in conversation