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: 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!

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
  • 1913 views
  • 0 likes
  • 3 in conversation