BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,
programs to check datasets that they have been updatedto day .Then check the contents of the datasets for data from yesterday.

if condition false then the program should check again in 30 min. if true then run all programs.

This process basically to shedules the job in batch

thanks,
chandra
4 REPLIES 4
Olivier
Pyrite | Level 9
Hi Chandra.
For information on dataset creation / last modification date, check the Contents procedure, or the SASHELP.VTABLE view.
For comparing datasets, use the Compare procedure.
To make SAS wait, you can use the SLEEP function within a Data step.
For conditionnal executing of SAS programs, see what you can do with macro language.
Regards;
Olivier
deleted_user
Not applicable
Hi Oliver,

THANKS FOR REPLAY . COULD YOU PLEASE SEND ME IF U HAVE ANY SAMPLE CODE FOR THAT


THANKS,
CHANDRA.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
The SAS support website http://support.sas.com is chock full of code samples and SAS documentation, which can be amazingly helpful with learning the SAS language to hone one's skills.

Another option is to use GOOGLE.COM or another search engine to search the SAS.COM site for code snippets and SAS User Group SUGI/SGF technical papers on these and other SAS programming topics.

Lastly, the SAS-L list archives are also a wealth of information for your benefit and ever-increasing knowledge opportunity.

Scott Barry
SBBWorks, Inc.

http://support.sas.com/
LinusH
Tourmaline | Level 20
Hi,
here is some sample (untested!) code you can start with. Have a look in doc for PROC COMPARE and SYSINFO for details.
About the rechecking, I suggest that you use a scheduling tool for that, such as cron in UNIX.

Regards,
Linus


%macro checkdata;

data _null_;
dsid = open('libname.table');
updated_dt = attrn(dsid, 'MODTE');
if "&SYSDATE9"D eq datepart(updated_dt) the call symput('UPDATED','Y');
else call symput('UPDATED','N');
run;

%if &UPDATED eq Y %then %do;

proc compare data=lib.today compare=lib.yesterday;
...;
run;

%if &SYSINFO ne 0 %then %do;
%include "program.sas";
%end;

%end;

%mend checkdata;

%checkdata;
Data never sleeps

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
  • 863 views
  • 0 likes
  • 4 in conversation