Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dependency Macro Ensuring data reliability in healthcare analytics

Similar presentations


Presentation on theme: "Dependency Macro Ensuring data reliability in healthcare analytics"— Presentation transcript:

1 Dependency Macro Ensuring data reliability in healthcare analytics
Lissa Bayang is a data consultant at Kaiser Permanente and has been using SAS in public health and healthcare for more than 10 years . Wayne Leonetti is a senior database analyst at Kaiser Permanente. He has been using SAS in healthcare since 1993 and became SAS Certified (v6) in 1999. Introduce yourself: your background (public health), now with Kaiser as a data consultant. First used SAS around 16 years ago in graduate school but consistently using it for about 10 years. It took awhile getting used to but now realize the power of SAS. Discuss why you decided to write this program. Rely on databases and other programs to run and we encounter delays.

2 Agenda Overview Setting up the macro Key parts Options Conclusion
Questions This macro is fairly simple compared to others. Mention these

3 Overview of the macro Definition Purpose Where?
Macro placed before main program Purpose How do we know that the data is ready? How recent is the data? Where? Used for high priority programs that need most recent data such as daily reports, and interactive population management tools

4 Setting up the macro %macro Depend ( Fylname, tLimit = '12:00:00't, Delay = 300, = , Subj = , Mesg = ); File name Maximum time limit that you want this macro to check Time delay between checking the files while being updated information with a subject and a message Tlimit: You can set this to whatever time you want. Delay is in seconds. Everything here can be overridden in the call program.

5 Key parts %local rc fid fidc ModifyDT Done Fail; %let Done = N;
%let Fail = N; rc = return code fid = file ID (open) / fidc (close) ModifyDT = Current date that you need your file to be This program will run if the dataset is not updated or if the process fails (timeframe has passed). ModifyDT usually uses the current date.

6 Nuts and Bolts %do %until(&Done=Y or &Fail=Y); %end;
%let rc=%sysfunc(filename(onefile,&fylname)); %let fid=%sysfunc(fopen(&onefile)); %let ModifyDT=%qsysfunc(finfo(&fid,Last Modified)); %let fidc=%sysfunc(fclose(&fid)); %let rc=%sysfunc(filename(onefile)); data _null_; tdt = datepart(input("&ModifyDT",datetime20.)); if tdt = date() then call symput("Done","Y"); else if time() gt &tLimit then call symput("Fail","Y"); else SleepTime = sleep(&delay,1); run; %end; This is where you set up your dates, the return codes, etc. Until the dataset is found or the process fails, this macro will continue to run until the allotted time you set or if one of the values are fulfilled. It looks for the return codes, the file ID, and the current date. Once the macro loop is done, it will either continue to your subsequent programming or it will terminate if you put the abend option. It will then send an to the programmer if it fais.

7 Options %abort abend; %end; %mend Depend; You can choose to terminate the program if the macro fails (e.g. does not update or goes beyond the time frame) Option to override the initial setup %Depend(Z:\Data\SAS\Databases\Tobacco\smokingdb.sas7bdat, delay=15, tLimit='09:00:00’t, subj=Tobacco Touches, mesg=process failed) These options allow you to terminate the program if the macro fails which means that any other programs dependent on this will not run. You can omit this. Also, the options in the call program allow you to be flexible. This also allow global usage of this macro.

8 Conclusion Very customizable Consider options depending on your needs
Integrate with almost any program Tested with local Base SAS but can be run in server mode

9 Questions?

10 Contact Information Name: Lissa Bayang Company: Kaiser Permanente City/State: Roseville, CA Phone: (916)


Download ppt "Dependency Macro Ensuring data reliability in healthcare analytics"

Similar presentations


Ads by Google