Presentation is loading. Please wait.

Presentation is loading. Please wait.

Greg Steffens Noumena Solutions

Similar presentations


Presentation on theme: "Greg Steffens Noumena Solutions"— Presentation transcript:

1 Greg Steffens Noumena Solutions noumena.solutions@gmail.com
Meta-Programming Greg Steffens Noumena Solutions

2 What’s it all about? Understand the objectives … or fail
To attain higher levels of data quality; more quickly; more consistently; more transparently; that protects patients’ privacy and enables meta-analyses across studies, TAs and drug companies to evaluate safety and efficacy Data standards are a means to that end, not the end itself – it’s just one component of a larger and much more important plan to get to our goals. Automation is another key component of the solution and automation used metadata and meta-programming We need to get out of the 1980’s world of single-use programing copied study to study

3 An Example Project – Creating Define Files
Recently completed a project to create define files for a company submitting to the FDA Outstanding feedback about the quality and time required, from a company organizing the eCTD … best defines they saw! Trained the programmer in one hour phone call and a follow-up call Goes far beyond commercial define file generators in content and automation An enhanced version of the technology I provided for both CDISC pilot projects

4 Steps in the Process Create metadata describing each study data library Enter a small amount of information in update metadata – primary key flags and derivation descriptions Apply updates and generate the define files – version 1.0 and 2.0 Validate the define files using xerces and pinnacle 21 Had first define files the first day of the project

5 Meta-programming to Create Technology
I defined “meta-programming” in my previous presentation “Maximizing Code Reuse with Meta- Programming” Multi-use code that can be used across and wide scope of projects without modification, using very minimal assumptions about the data Write code to underlying patterns and problems, not to surface-level operational processes. This is what “noumena” means, as contrasted to “phenomena” Multi-use meta-programs generate single-use programs that meets all the objectives stated earlier Multi-use validation also saves study programming time in reducing the need for study-level validation of double programming, etc.

6 Required Skills to be a Meta-Programmer
Need to be one of the best study programmers Need to know systems design principles of structured programming and relational data design for metadata and definition data The ability to see those underlying patterns and write code to those patterns A much deeper knowledge of SAS that required by study programming. Don’t expect study programming techniques to be able to meet the requirements of meta- programming

7 Names Single-use programs hard-code names of variables and data sets
The next step is to parameterize names and use macro variable substitution in the code. This will enable the use of your code on a wider scope of data, even when variable names change Now assign a default value to the macro parameters so that the parameter does not need to be specified in typical copies. if aestrtdt >= randdt then teae = 1; else teae = 0; If &aestrtdt >- &randdt then &teae = 1; else &teae = 0; %macro teae (aestrtdt=aestrtdt,randdt=randdt,teae=teae);

8 Names Even Better Not quite to the end yet …
This approach is a good step but when variable names are non-standard the programmer calling the macro needs to specify the same information repeatedly So, save the names in a data set … now we are starting some simple metadata data _null_; set metadata (where = (dsn=‘AE’); call symputx(‘aestrtdt’,aestrtdt,’l); run;

9 Confirmation and “Bullet-Proofing”
What if the user is wrong? proc contents data = &data out = contents noprint; run; data _null_; if _n_ = 1 then has_aestrtdt = 0; if eof then call symputx(‘has_aestrtdt’,has_aestrtdt,’L’); set contents end = eof; if upcase(name) = upcase(“&aestrtdt”) then has_aestrtdt = 1; retain has_:; %if ^ &has_aestrtdt %then %let aestrtdt =; Take extra time to add these kinds of checks to make the meta-program easier to use

10 What Else Can Parameters and Metadata Do?
Specify whether something should be done or not, with a Boolean parameter Do you want to include SAS code snippets in the define file? Specify which of several variations you want Define_version 1.0 or 2.0 Where is the input? MDLIB - Libref where metadata resides Where should the output be created? OUTXML – location of the define file to be created

11 Multi-Use of Metadata Remember to look to underlying patterns
Now that the metadata exists, what other uses can we put it to Creating the data sets with a DTE macro Data edit checks as data is collected, but checking data extracts and iterations against the specifications

12 Processing codelist ranges
The define file supports codelists that include numeric ranges These ranges may incorrectly overlap each other The programming to look for overlapping ranges requires a double SET statement that is not usually needed in study programming Looking to underlying patterns it can be realized that a range check macro can be used for several other data deisgns AE and CM data sets with start and end dates defining ranges that may have incorrect overlaps Proc format cntlin data set includes the START and END variables defining ranges


Download ppt "Greg Steffens Noumena Solutions"

Similar presentations


Ads by Google