Programming Gems that are worth learning SQL for! Pamela L. Reading, Rho, Inc., Chapel Hill, NC
|
|
- Amberly Chandler
- 5 years ago
- Views:
Transcription
1 Paper CC-05 Programming Gems that are worth learning SQL for! Pamela L. Reading, Rho, Inc., Chapel Hill, NC ABSTRACT For many SAS users, learning SQL syntax appears to be a significant effort with a low rate of return, because their routine programming tasks can be done just as easily with the base SAS syntax they already know. But there are some tasks that are very simple to do in SQL that are quite difficult in base SAS. If your assignment involves one of these tasks, then the effort to learn a little SQL will pay off handsomely! I will present a few little gems of SQL that have served me well in pharmaceutical programming. INTRODUCTION As a long-time user of base SAS, I am generally a reluctant user of SQL. The energy required to learn how to do what I want in SQL always seemed high in comparison to the outcome. But I have found some things that are so easy to do in SQL and so hard to do in base SAS that I m gradually being converted. I d like to quickly present a few gems that I wouldn t do any other way. You may not need these often. You may not need them at all. But file them away in case you do, because you could spend inordinate amounts of time trying to do them the base SAS way. Cartesian Product Merge We had a request for an Adverse Event analysis file. For obscure reasons known only to those who practice the black art of Statistics, it needed to have 1 record for every possible combination of AE Term and ID. For example, if there were 5 unique subjects and 10 unique Adverse Events among them, we needed a file with 50 records 10 records for each ID. We would then create variables indicating whether the subject suffered that particular AE. (The statisticians rethought this approach when we moved on to a bigger study!). This kind of file, which is called the Cartesian product in set theory, is the first step in EVERY merge done by SQL. And the code is simple: * get a file of unique AE terms; proc sort data=aexp nodupkey out=aexp_term (keep=preferred_term ) * get a file of unique IDs ; proc sort data=aexp nodupkey out=aexp_ids (keep=subjectid); by subjectid; * SQL Cartesian merge; proc sql; create table aexp_shell as select * from aexp_term, aexp_ids; quit; Those of you familiar with SQL will notice that this SQL code is lacking the usual WHERE clause that subsets the Cartesian merge to select only those records where variables match (like the BY statements in SAS MERGE). There are no common variables, so SQL creates a file containing two variables, Preferred_Term and SubjectID, with records for all possible pairs. This can be done without too much trouble in base SAS, but it involves the use of the POINT option in the data step, a command that many programmers tend to avoid. I don t think I ve ever used it before, but in the interest of equal time, I did my research and found this code on the SAS tech support web search. Here is the final step in base SAS, starting with the same two datasets created above:
2 data aexp_shell; set aexp_ids; do i=1 to n; set aexp_term point=i nobs=n; output; end; The SQL approach is more efficient, as the following tests show: Test 1 Test 2 Number of AE records Number of Unique Ids Number of Unique Terms Number of Records in Cartesian Product Real Time SQL 0.29 sec sec Real Time Base SAS 0.29 sec sec CPU Time SQL 0.39 sec 6.81 sec CPU Time Base SAS 0.39 sec 7.08 sec Figure 1 Fuzzy Merge: I do a lot of work requiring the querying of laboratory data using normal ranges specified elsewhere (usually in a spreadsheet). Lab normal ranges are often gender specific, and tests done at local site laboratories will be site specific. So I receive a spreadsheet that looks like this: Site Lab Test Test Code SITE1 Glucose GLUC SITE1 Creatinine CREAT SITE1 AST/SGOT AST SITE1 ALT/SGPT ALT SITE1 Calcium CALC SITE2 Glucose GLUC SITE2 Creatinine CREAT SITE2 AST/SGOT AST SITE2 ALT/SGPT ALT SITE2 Calcium CALC Figure 2 Once this data is imported (using PROC IMPORT or DDE), it s a simple base SAS task to read this and put out a SAS file with one record for each combination of Test Code, Site and Gender. Each record contains the appropriate upper and lower limits. Merge that with your lab records by Test Code, Site and Gender and do the comparison. The file would look something like this: Site LabTest TestCode Gender SITE1 Glucose GLUC M SITE1 Glucose GLUC F SITE1 Creatinine CREAT M SITE1 Creatinine CREAT F Figure 3
3 But wait! Some lab tests also have age-specific ranges. And what if the normal ranges changed on a given date due to a procedural modification? Now your lab normal specification table is a lot more complicated: Site Lab Test Test Code From Age: At Least To Age: But Not yet Range Effective Start Date Range Effective End Date SITE1 Glucose GLUC /1/2000 1/1/2010 SITE1 Glucose GLUC /1/2000 1/1/2010 SITE1 Creatinine CREAT /1/2000 1/1/2010 SITE1 AST/SGOT AST /1/2000 1/1/2010 SITE1 ALT/SGPT ALT /1/2000 1/1/2010 SITE1 Calcium CALC /1/2000 1/1/2010 SITE2 Glucose GLUC /10/2003 1/1/2010 SITE2 Glucose GLUC /10/2003 1/1/2010 SITE2 Creatinine CREAT /10/2003 2/8/2004 SITE2 Creatinine CREAT /9/2004 1/1/2010 SITE2 AST/SGOT AST /10/2003 1/1/2010 SITE2 ALT/SGPT ALT /10/2003 1/1/2010 SITE2 Calcium CALC /10/2003 2/8/2004 SITE2 Calcium CALC /9/2004 1/1/2010 Figure 4 You now need to compare the date of the test with an effective date range, and the age of the subject with an age range. Doing one of the two is not too awful in base SAS, although it would require a significant restructure of the spreadsheet data. But trying to merge using both age and date ranges is quite a difficult problem. SQL to the rescue! We restructure the file in the same way, creating separate records for male and female: Site LabTest TestCode Gender Age Age Date Date SITE2 Glucose GLUC M /1/2000 1/1/2010 SITE2 Glucose GLUC F /1/2000 1/1/2010 SITE2 Glucose GLUC M /1/2000 1/1/2010 SITE2 Glucose GLUC F /1/2000 1/1/2010 SITE2 Creatinine CREAT M /10/2003 2/8/2004 SITE2 Creatinine CREAT F /10/2003 2/8/2004 SITE2 Creatinine CREAT M /9/2004 1/1/2010 SITE2 Creatinine CREAT F /9/2004 1/1/2010 Figure 5
4 Then we use an SQL merge to match on Site, Gender, age and effective dates: PROC sql; create table _labcks as select a.*, b.* from labtests a, labnorm b where ( a.testcode = b.testcode and a.site = b.site and a.sex = b.gender and (b.lowage <= a.age <= b.highage ) and (b.lowdate < a.labdt <= b.highdate ) ) ; QUIT; In SQL terminology, file A is my laboratory result file LABTESTS, in which SEX is the variable that contains the patient gender code, AGE is the age (in the same unit as the normals file) and LABDT is the lab test date. B is the lab normals file LABNORM which is illustrated above (Fig. 5). SQL Summary Functions: In pharmaceutical reporting, we always need to display the population totals for each group being analyzed the N value if the statistics are to be interpreted properly. In some of our table generation procedures, the N value for each column needs to be in a SAS macro variable. Using base SAS, this would be accomplished with a procedure to compute the totals by group (PROC SUMMARY, PROC UNIVARIATE), using an OUTPUT statement to write the values to a dataset. Then a second data step using the SYMPUT function would write each value to a macro variable. Placebo (Group 1) Drug Group 2 Total Characteristic N=14 N=16 N=30 Weight (kg) Mean (SD) Median 7.4 (1.04) (0.43) (0.94) 7.2 Range (7,9) (8,9) (7,9) This can all be done in one easy SQL step: PROC sql noprint; select count(distinct subjid) into: tot1 from all where treatment=1; select count(distinct subjid) into: tot2 from all where treatment=2; select count(distinct subjid) into: tot3 from all; QUIT; %PUT &TOT1 &TOT2 &TOT3; The log will show that the three macro variables equal: 14, 16 and 30, our column N values. The INTO: tell SQL that the variable being named is a macro variable. By using the summary function COUNT(DISTINCT), you can use a source file that contains multiple records for each ID, providing all possible IDs are represented at least once.
5 CONCLUSION There are some tasks that are so much easier to do in SQL than in base SAS that it is worth learning a little SQL to do them. I hope this paper has whet your appetite and that you ll explore SQL further to find other gems that will make your programming job easier. REFERENCES Foley, Malachy J. Fuzzy Merges: Examples and Techniques Proceedings of the Twenty-Fourth Annual SAS Users Group International Conference (2002), Cary NC: SAS Institute Inc. pp Foley, Malachy J. Merging: Comparing the DATA Step with SQL Proceedings of the Tenth Annual Southeast SAS Users Group Conference (2002), Cary NC: SAS Institute Inc. pp Hermansen, Sigurd W. Structured Query Language: Logic, Structure and Syntax Proceedings of the Tenth Annual Southeast SAS Users Group Conference (2002), Cary NC: SAS Institute Inc. pp CONTACT INFORMATION You can contact the author at: Pamela Reading Rho, Inc Quadrangle Drive Chapel Hill, NC Work Phone: Pamela_Reading@rhoworld.com SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration.
Hypothesis Testing: An SQL Analogy
Hypothesis Testing: An SQL Analogy Leroy Bracken, Boulder Creek, CA Paul D Sherman, San Jose, CA ABSTRACT This paper is all about missing data. Do you ever know something about someone but don't know who
More informationThere s No Such Thing as Normal Clinical Trials Data, or Is There? Daphne Ewing, Octagon Research Solutions, Inc., Wayne, PA
Paper HW04 There s No Such Thing as Normal Clinical Trials Data, or Is There? Daphne Ewing, Octagon Research Solutions, Inc., Wayne, PA ABSTRACT Clinical Trials data comes in all shapes and sizes depending
More informationSAS Macro Dynamics - From Simple Basics to Powerful Invocations Rick Andrews, Office of the Actuary, CMS, Baltimore, MD
Paper BB-7 SAS Macro Dynamics - From Simple Basics to Powerful Invocations Rick Andrews, Office of the Actuary, CMS, Baltimore, MD ABSTRACT The SAS Macro Facility offers a mechanism for expanding and customizing
More informationA Quick and Gentle Introduction to PROC SQL
ABSTRACT Paper B2B 9 A Quick and Gentle Introduction to PROC SQL Shane Rosanbalm, Rho, Inc. Sam Gillett, Rho, Inc. If you are afraid of SQL, it is most likely because you haven t been properly introduced.
More informationGet SAS sy with PROC SQL Amie Bissonett, Pharmanet/i3, Minneapolis, MN
PharmaSUG 2012 - Paper TF07 Get SAS sy with PROC SQL Amie Bissonett, Pharmanet/i3, Minneapolis, MN ABSTRACT As a data analyst for genetic clinical research, I was often working with familial data connecting
More informationUsing PROC SQL to Generate Shift Tables More Efficiently
ABSTRACT SESUG Paper 218-2018 Using PROC SQL to Generate Shift Tables More Efficiently Jenna Cody, IQVIA Shift tables display the change in the frequency of subjects across specified categories from baseline
More informationWhen Simpler is Better Visualizing Laboratory Data Using SG Procedures Wei Cheng, Isis Pharmaceuticals, Inc., Carlsbad, CA
When Simpler is Better Visualizing Laboratory Data Using SG Procedures Wei Cheng, Isis Pharmaceuticals, Inc., Carlsbad, CA ABSTRACT In SAS 9.2, SAS/GRAPH introduces a family of new procedures to create
More informationOne-PROC-Away: The Essence of an Analysis Database Russell W. Helms, Ph.D. Rho, Inc.
One-PROC-Away: The Essence of an Analysis Database Russell W. Helms, Ph.D. Rho, Inc. Chapel Hill, NC RHelms@RhoWorld.com www.rhoworld.com Presented to ASA/JSM: San Francisco, August 2003 One-PROC-Away
More informationThe Power of Combining Data with the PROC SQL
ABSTRACT Paper CC-09 The Power of Combining Data with the PROC SQL Stacey Slone, University of Kentucky Markey Cancer Center Combining two data sets which contain a common identifier with a MERGE statement
More informationIt s Proc Tabulate Jim, but not as we know it!
Paper SS02 It s Proc Tabulate Jim, but not as we know it! Robert Walls, PPD, Bellshill, UK ABSTRACT PROC TABULATE has received a very bad press in the last few years. Most SAS Users have come to look on
More informationAnatomy of a Merge Gone Wrong James Lew, Compu-Stat Consulting, Scarborough, ON, Canada Joshua Horstman, Nested Loop Consulting, Indianapolis, IN, USA
ABSTRACT PharmaSUG 2013 - Paper TF22 Anatomy of a Merge Gone Wrong James Lew, Compu-Stat Consulting, Scarborough, ON, Canada Joshua Horstman, Nested Loop Consulting, Indianapolis, IN, USA The merge is
More informationUsing PROC SQL to Calculate FIRSTOBS David C. Tabano, Kaiser Permanente, Denver, CO
Using PROC SQL to Calculate FIRSTOBS David C. Tabano, Kaiser Permanente, Denver, CO ABSTRACT The power of SAS programming can at times be greatly improved using PROC SQL statements for formatting and manipulating
More informationExporting Variable Labels as Column Headers in Excel using SAS Chaitanya Chowdagam, MaxisIT Inc., Metuchen, NJ
Paper 74924-2011 Exporting Variable Labels as Column Headers in Excel using SAS Chaitanya Chowdagam, MaxisIT Inc., Metuchen, NJ ABSTRACT Excel output is the desired format for most of the ad-hoc reports
More informationAre you Still Afraid of Using Arrays? Let s Explore their Advantages
Paper CT07 Are you Still Afraid of Using Arrays? Let s Explore their Advantages Vladyslav Khudov, Experis Clinical, Kharkiv, Ukraine ABSTRACT At first glance, arrays in SAS seem to be a complicated and
More informationUsing Templates Created by the SAS/STAT Procedures
Paper 081-29 Using Templates Created by the SAS/STAT Procedures Yanhong Huang, Ph.D. UMDNJ, Newark, NJ Jianming He, Solucient, LLC., Berkeley Heights, NJ ABSTRACT SAS procedures provide a large quantity
More informationPharmaceuticals, Health Care, and Life Sciences
Successful Lab Result Conversion for LAB Analysis Data with Minimum Effort Pushpa Saranadasa, Merck & Co., Inc. INTRODUCTION In the pharmaceutical industry, the statistical results of a clinical trial's
More informationClinical Data Visualization using TIBCO Spotfire and SAS
ABSTRACT SESUG Paper RIV107-2017 Clinical Data Visualization using TIBCO Spotfire and SAS Ajay Gupta, PPD, Morrisville, USA In Pharmaceuticals/CRO industries, you may receive requests from stakeholders
More informationSorting big datasets. Do we really need it? Daniil Shliakhov, Experis Clinical, Kharkiv, Ukraine
PharmaSUG 2015 - Paper QT21 Sorting big datasets. Do we really need it? Daniil Shliakhov, Experis Clinical, Kharkiv, Ukraine ABSTRACT Very often working with big data causes difficulties for SAS programmers.
More information%MAKE_IT_COUNT: An Example Macro for Dynamic Table Programming Britney Gilbert, Juniper Tree Consulting, Porter, Oklahoma
Britney Gilbert, Juniper Tree Consulting, Porter, Oklahoma ABSTRACT Today there is more pressure on programmers to deliver summary outputs faster without sacrificing quality. By using just a few programming
More informationCleaning up your SAS log: Note Messages
Paper 9541-2016 Cleaning up your SAS log: Note Messages ABSTRACT Jennifer Srivastava, Quintiles Transnational Corporation, Durham, NC As a SAS programmer, you probably spend some of your time reading and
More informationAn Introduction to Analysis (and Repository) Databases (ARDs)
An Introduction to Analysis (and Repository) TM Databases (ARDs) Russell W. Helms, Ph.D. Rho, Inc. Chapel Hill, NC RHelms@RhoWorld.com www.rhoworld.com Presented to DIA-CDM: Philadelphia, PA, 1 April 2003
More informationGetting Up to Speed with PROC REPORT Kimberly LeBouton, K.J.L. Computing, Rossmoor, CA
SESUG 2012 Paper HW-01 Getting Up to Speed with PROC REPORT Kimberly LeBouton, K.J.L. Computing, Rossmoor, CA ABSTRACT Learning the basics of PROC REPORT can help the new SAS user avoid hours of headaches.
More informationThe Dataset Diet How to transform short and fat into long and thin
Paper TU06 The Dataset Diet How to transform short and fat into long and thin Kathryn Wright, Oxford Pharmaceutical Sciences, UK ABSTRACT What do you do when you are given a dataset with one observation
More informationData Edit-checks Integration using ODS Tagset Niraj J. Pandya, Element Technologies Inc., NJ Vinodh Paida, Impressive Systems Inc.
PharmaSUG2011 - Paper DM03 Data Edit-checks Integration using ODS Tagset Niraj J. Pandya, Element Technologies Inc., NJ Vinodh Paida, Impressive Systems Inc., TX ABSTRACT In the Clinical trials data analysis
More informationPROC MEANS for Disaggregating Statistics in SAS : One Input Data Set and One Output Data Set with Everything You Need
ABSTRACT Paper PO 133 PROC MEANS for Disaggregating Statistics in SAS : One Input Data Set and One Output Data Set with Everything You Need Imelda C. Go, South Carolina Department of Education, Columbia,
More informationTYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT
PRIMER FOR ACS OUTCOMES RESEARCH COURSE: TYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT STEP 1: Install STATA statistical software. STEP 2: Read through this primer and complete the
More informationSAS Macros for Grouping Count and Its Application to Enhance Your Reports
SAS Macros for Grouping Count and Its Application to Enhance Your Reports Shi-Tao Yeh, EDP Contract Services, Bala Cynwyd, PA ABSTRACT This paper provides two SAS macros, one for one grouping variable,
More informationDitch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA
ABSTRACT Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA Data set documentation is essential to good
More informationTable of Contents. The RETAIN Statement. The LAG and DIF Functions. FIRST. and LAST. Temporary Variables. List of Programs.
Table of Contents List of Programs Preface Acknowledgments ix xvii xix The RETAIN Statement Introduction 1 Demonstrating a DATA Step with and without a RETAIN Statement 1 Generating Sequential SUBJECT
More information5b. Descriptive Statistics - Part II
5b. Descriptive Statistics - Part II In this lab we ll cover how you can calculate descriptive statistics that we discussed in class. We also learn how to summarize large multi-level databases efficiently,
More informationOmitting Records with Invalid Default Values
Paper 7720-2016 Omitting Records with Invalid Default Values Lily Yu, Statistics Collaborative Inc. ABSTRACT Many databases include default values that are set inappropriately. These default values may
More informationABSTRACT DATA CLARIFCIATION FORM TRACKING ORACLE TABLE INTRODUCTION REVIEW QUALITY CHECKS
Efficient SAS Quality Checks: Unique Error Identification And Enhanced Data Management Analysis Jim Grudzinski, Biostatistics Manager Of SAS Programming Covance Periapproval Services Inc, Radnor, PA ABSTRACT
More informationcapabilities and their overheads are therefore different.
Applications Development 3 Access DB2 Tables Using Keylist Extraction Berwick Chan, Kaiser Permanente, Oakland, Calif Raymond Wan, Raymond Wan Associate Inc., Oakland, Calif Introduction The performance
More informationTechniques for Large Scale Data Linking in SAS. By Damien John Melksham
Techniques for Large Scale Data Linking in SAS By Damien John Melksham What is Data Linking? Called everything imaginable: Data linking, record linkage, mergepurge, entity resolution, deduplication, fuzzy
More information%ANYTL: A Versatile Table/Listing Macro
Paper AD09-2009 %ANYTL: A Versatile Table/Listing Macro Yang Chen, Forest Research Institute, Jersey City, NJ ABSTRACT Unlike traditional table macros, %ANTL has only 3 macro parameters which correspond
More informationChecking for Duplicates Wendi L. Wright
Checking for Duplicates Wendi L. Wright ABSTRACT This introductory level paper demonstrates a quick way to find duplicates in a dataset (with both simple and complex keys). It discusses what to do when
More informationPaper S Data Presentation 101: An Analyst s Perspective
Paper S1-12-2013 Data Presentation 101: An Analyst s Perspective Deanna Chyn, University of Michigan, Ann Arbor, MI Anca Tilea, University of Michigan, Ann Arbor, MI ABSTRACT You are done with the tedious
More informationArthur L. Carpenter California Occidental Consultants, Oceanside, California
Paper 028-30 Storing and Using a List of Values in a Macro Variable Arthur L. Carpenter California Occidental Consultants, Oceanside, California ABSTRACT When using the macro language it is not at all
More informationABSTRACT INTRODUCTION WHERE TO START? 1. DATA CHECK FOR CONSISTENCIES
Developing Integrated Summary of Safety Database using CDISC Standards Rajkumar Sharma, Genentech Inc., A member of the Roche Group, South San Francisco, CA ABSTRACT Most individual trials are not powered
More informationPosters. Workarounds for SASWare Ballot Items Jack Hamilton, First Health, West Sacramento, California USA. Paper
Paper 223-25 Workarounds for SASWare Ballot Items Jack Hamilton, First Health, West Sacramento, California USA ABSTRACT As part of its effort to insure that SAS Software is useful to its users, SAS Institute
More informationAdvanced Visualization using TIBCO Spotfire and SAS
PharmaSUG 2018 - Paper DV-04 ABSTRACT Advanced Visualization using TIBCO Spotfire and SAS Ajay Gupta, PPD, Morrisville, USA In Pharmaceuticals/CRO industries, you may receive requests from stakeholders
More informationMultiple Graphical and Tabular Reports on One Page, Multiple Ways to Do It Niraj J Pandya, CT, USA
Paper TT11 Multiple Graphical and Tabular Reports on One Page, Multiple Ways to Do It Niraj J Pandya, CT, USA ABSTRACT Creating different kind of reports for the presentation of same data sounds a normal
More informationA Methodology for Truly Dynamic Prompting in SAS Stored Processes
SESUG 2015 Paper AD-172 A Methodology for Truly Dynamic Prompting in SAS Stored Processes Haikuo Bian, Regions Bank; Carlos Jimenez, Regions Bank; David Maddox, Regions Bank ABSTRACT Dynamic prompts in
More informationINTRODUCTION TO PROC SQL JEFF SIMPSON SYSTEMS ENGINEER
INTRODUCTION TO PROC SQL JEFF SIMPSON SYSTEMS ENGINEER THE SQL PROCEDURE The SQL procedure: enables the use of SQL in SAS is part of Base SAS software follows American National Standards Institute (ANSI)
More information186 Statistics, Data Analysis and Modeling. Proceedings of MWSUG '95
A Statistical Analysis Macro Library in SAS Carl R. Haske, Ph.D., STATPROBE, nc., Ann Arbor, M Vivienne Ward, M.S., STATPROBE, nc., Ann Arbor, M ABSTRACT Statistical analysis plays a major role in pharmaceutical
More informationGary L. Katsanis, Blue Cross and Blue Shield of the Rochester Area, Rochester, NY
Table Lookups in the SAS Data Step Gary L. Katsanis, Blue Cross and Blue Shield of the Rochester Area, Rochester, NY Introduction - What is a Table Lookup? You have a sales file with one observation for
More informationData Manipulation with SQL Mara Werner, HHS/OIG, Chicago, IL
Paper TS05-2011 Data Manipulation with SQL Mara Werner, HHS/OIG, Chicago, IL Abstract SQL was developed to pull together information from several different data tables - use this to your advantage as you
More informationA Guided Tour Through the SAS Windowing Environment Casey Cantrell, Clarion Consulting, Los Angeles, CA
A Guided Tour Through the SAS Windowing Environment Casey Cantrell, Clarion Consulting, Los Angeles, CA ABSTRACT The SAS system running in the Microsoft Windows environment contains a multitude of tools
More informationUsing Metadata Queries To Build Row-Level Audit Reports in SAS Visual Analytics
SAS6660-2016 Using Metadata Queries To Build Row-Level Audit Reports in SAS Visual Analytics ABSTRACT Brandon Kirk and Jason Shoffner, SAS Institute Inc., Cary, NC Sensitive data requires elevated security
More informationStandard Safety Visualization Set-up Using Spotfire
Paper SD08 Standard Safety Visualization Set-up Using Spotfire Michaela Mertes, F. Hoffmann-La Roche, Ltd., Basel, Switzerland ABSTRACT Stakeholders are requesting real-time access to clinical data to
More informationSAS ENTERPRISE GUIDE USER INTERFACE
Paper 294-2008 What s New in the 4.2 releases of SAS Enterprise Guide and the SAS Add-In for Microsoft Office I-kong Fu, Lina Clover, and Anand Chitale, SAS Institute Inc., Cary, NC ABSTRACT SAS Enterprise
More informationHow to Create Data-Driven Lists
Paper 9540-2016 How to Create Data-Driven Lists Kate Burnett-Isaacs, Statistics Canada ABSTRACT As SAS programmers we often want our code or program logic to be driven by the data at hand, rather than
More informationA SAS/AF Application for Linking Demographic & Laboratory Data For Participants in Clinical & Epidemiologic Research Studies
Paper 208 A SAS/AF Application for Linking Demographic & Laboratory Data For Participants in Clinical & Epidemiologic Research Studies Authors: Emily A. Mixon; Karen B. Fowler, University of Alabama at
More informationHow to approach a computational problem
How to approach a computational problem A lot of people find computer programming difficult, especially when they first get started with it. Sometimes the problems are problems specifically related to
More informationIf You Need These OBS and These VARS, Then Drop IF, and Keep WHERE Jay Iyengar, Data Systems Consultants LLC
Paper 2417-2018 If You Need These OBS and These VARS, Then Drop IF, and Keep WHERE Jay Iyengar, Data Systems Consultants LLC ABSTRACT Reading data effectively in the DATA step requires knowing the implications
More informationSAS Programs SAS Lecture 4 Procedures. Aidan McDermott, April 18, Outline. Internal SAS formats. SAS Formats
SAS Programs SAS Lecture 4 Procedures Aidan McDermott, April 18, 2006 A SAS program is in an imperative language consisting of statements. Each statement ends in a semi-colon. Programs consist of (at least)
More informationLecture 1 Getting Started with SAS
SAS for Data Management, Analysis, and Reporting Lecture 1 Getting Started with SAS Portions reproduced with permission of SAS Institute Inc., Cary, NC, USA Goals of the course To provide skills required
More informationReport Writing, SAS/GRAPH Creation, and Output Verification using SAS/ASSIST Matthew J. Becker, ST TPROBE, inc., Ann Arbor, MI
Report Writing, SAS/GRAPH Creation, and Output Verification using SAS/ASSIST Matthew J. Becker, ST TPROBE, inc., Ann Arbor, MI Abstract Since the release of SAS/ASSIST, SAS has given users more flexibility
More informationChapter 1. Introduction. 1.1 More about SQL More about This Book 5
Chapter 1 Introduction 1.1 More about SQL 2 1.2 More about This Book 5 SAS defines Structured Query Language (SQL) as a standardized, widely used language that retrieves data from and updates data in tables
More informationA Practical Introduction to SAS Data Integration Studio
ABSTRACT A Practical Introduction to SAS Data Integration Studio Erik Larsen, Independent Consultant, Charleston, SC Frank Ferriola, Financial Risk Group, Cary, NC A useful and often overlooked tool which
More information2 = Disagree 3 = Neutral 4 = Agree 5 = Strongly Agree. Disagree
PharmaSUG 2012 - Paper HO01 Multiple Techniques for Scoring Quality of Life Questionnaires Brandon Welch, Rho, Inc., Chapel Hill, NC Seungshin Rhee, Rho, Inc., Chapel Hill, NC ABSTRACT In the clinical
More informationChapter 2 The SAS Environment
Chapter 2 The SAS Environment Abstract In this chapter, we begin to become familiar with the basic SAS working environment. We introduce the basic 3-screen layout, how to navigate the SAS Explorer window,
More informationSAS Training Spring 2006
SAS Training Spring 2006 Coxe/Maner/Aiken Introduction to SAS: This is what SAS looks like when you first open it: There is a Log window on top; this will let you know what SAS is doing and if SAS encountered
More informationCan you decipher the code? If you can, maybe you can break it. Jay Iyengar, Data Systems Consultants LLC, Oak Brook, IL
Paper 11667-2016 Can you decipher the code? If you can, maybe you can break it. Jay Iyengar, Data Systems Consultants LLC, Oak Brook, IL ABSTRACT You would think that training as a code breaker, similar
More informationStatistics and Data Analysis. Common Pitfalls in SAS Statistical Analysis Macros in a Mass Production Environment
Common Pitfalls in SAS Statistical Analysis Macros in a Mass Production Environment Huei-Ling Chen, Merck & Co., Inc., Rahway, NJ Aiming Yang, Merck & Co., Inc., Rahway, NJ ABSTRACT Four pitfalls are commonly
More informationSAS Macro Dynamics: from Simple Basics to Powerful Invocations Rick Andrews, Office of Research, Development, and Information, Baltimore, MD
ABSTRACT CODERS CORNER SAS Macro Dynamics: from Simple Basics to Powerful Invocations Rick Andrews, Office of Research, Development, and Information, Baltimore, MD The SAS Macro Facility offers a mechanism
More informationPROC SQL vs. DATA Step Processing. T Winand, Customer Success Technical Team
PROC SQL vs. DATA Step Processing T Winand, Customer Success Technical Team Copyright 2012, SAS Institute Inc. All rights reserved. Agenda PROC SQL VS. DATA STEP PROCESSING Comparison of DATA Step and
More informationQuality Control of Clinical Data Listings with Proc Compare
ABSTRACT Quality Control of Clinical Data Listings with Proc Compare Robert Bikwemu, Pharmapace, Inc., San Diego, CA Nicole Wallstedt, Pharmapace, Inc., San Diego, CA Checking clinical data listings with
More information100 THE NUANCES OF COMBINING MULTIPLE HOSPITAL DATA
Paper 100 THE NUANCES OF COMBINING MULTIPLE HOSPITAL DATA Jontae Sanders, MPH, Charlotte Baker, DrPH, MPH, CPH, and C. Perry Brown, DrPH, MSPH, Florida Agricultural and Mechanical University ABSTRACT Hospital
More informationPaper HOW-06. Tricia Aanderud, And Data Inc, Raleigh, NC
Paper HOW-06 Building Your First SAS Stored Process Tricia Aanderud, And Data Inc, Raleigh, NC ABSTRACT Learn how to convert a simple SAS macro into three different stored processes! Using examples from
More informationUsing Proc Freq for Manageable Data Summarization
1 CC27 Using Proc Freq for Manageable Data Summarization Curtis Wolf, DataCeutics, Inc. A SIMPLE BUT POWERFUL PROC The Frequency procedure can be very useful for getting a general sense of the contents
More informationPharmaSUG China 2018 Paper AD-62
PharmaSUG China 2018 Paper AD-62 Decomposition and Reconstruction of TLF Shells - A Simple, Fast and Accurate Shell Designer Chengeng Tian, dmed Biopharmaceutical Co., Ltd., Shanghai, China ABSTRACT Table/graph
More informationTen Great Reasons to Learn SAS Software's SQL Procedure
Ten Great Reasons to Learn SAS Software's SQL Procedure Kirk Paul Lafler, Software Intelligence Corporation ABSTRACT The SQL Procedure has so many great features for both end-users and programmers. It's
More informationFrom Just Shells to a Detailed Specification Document for Tables, Listings and Figures Supriya Dalvi, InVentiv Health Clinical, Mumbai, India
PharmaSUG 2014 - Paper IB07 From Just Shells to a Detailed Specification Document for Tables, Listings and Figures Supriya Dalvi, InVentiv Health Clinical, Mumbai, India ABSTRACT We are assigned a new
More informationStat Wk 3. Stat 342 Notes. Week 3, Page 1 / 71
Stat 342 - Wk 3 What is SQL Proc SQL 'Select' command and 'from' clause 'group by' clause 'order by' clause 'where' clause 'create table' command 'inner join' (as time permits) Stat 342 Notes. Week 3,
More informationGuidelines for Coding of SAS Programs Thomas J. Winn, Jr. Texas State Auditor s Office
Guidelines for Coding of SAS Programs Thomas J. Winn, Jr. Texas State Auditor s Office Abstract This paper presents a set of proposed guidelines that could be used for writing SAS code that is clear, efficient,
More informationCreating Forest Plots Using SAS/GRAPH and the Annotate Facility
PharmaSUG2011 Paper TT12 Creating Forest Plots Using SAS/GRAPH and the Annotate Facility Amanda Tweed, Millennium: The Takeda Oncology Company, Cambridge, MA ABSTRACT Forest plots have become common in
More informationProgramming Beyond the Basics. Find() the power of Hash - How, Why and When to use the SAS Hash Object John Blackwell
Find() the power of Hash - How, Why and When to use the SAS Hash Object John Blackwell ABSTRACT The SAS hash object has come of age in SAS 9.2, giving the SAS programmer the ability to quickly do things
More informationOUT= IS IN: VISUALIZING PROC COMPARE RESULTS IN A DATASET
OUT= IS IN: VISUALIZING PROC COMPARE RESULTS IN A DATASET Prasad Ilapogu, Ephicacy Consulting Group; Masaki Mihaila, Pfizer; ABSTRACT Proc compare is widely used in the pharmaceutical world to validate
More informationWant to Do a Better Job? - Select Appropriate Statistical Analysis in Healthcare Research
Want to Do a Better Job? - Select Appropriate Statistical Analysis in Healthcare Research Liping Huang, Center for Home Care Policy and Research, Visiting Nurse Service of New York, NY, NY ABSTRACT The
More informationBasic SAS Hash Programming Techniques Applied in Our Daily Work in Clinical Trials Data Analysis
PharmaSUG China 2018 Paper 18 Basic SAS Hash Programming Techniques Applied in Our Daily Work in Clinical Trials Data Analysis ABSTRACT Fanyu Li, MSD, Beijing, China With the development of SAS programming
More information50 WAYS TO MERGE YOUR DATA INSTALLMENT 1 Kristie Schuster, LabOne, Inc., Lenexa, Kansas Lori Sipe, LabOne, Inc., Lenexa, Kansas
Paper 103-26 50 WAYS TO MERGE YOUR DATA INSTALLMENT 1 Kristie Schuster, LabOne, Inc., Lenexa, Kansas Lori Sipe, LabOne, Inc., Lenexa, Kansas ABSTRACT When you need to join together two datasets, how do
More informationEXAMPLE 3: MATCHING DATA FROM RESPONDENTS AT 2 OR MORE WAVES (LONG FORMAT)
EXAMPLE 3: MATCHING DATA FROM RESPONDENTS AT 2 OR MORE WAVES (LONG FORMAT) DESCRIPTION: This example shows how to combine the data on respondents from the first two waves of Understanding Society into
More informationSAS CLINICAL SYLLABUS. DURATION: - 60 Hours
SAS CLINICAL SYLLABUS DURATION: - 60 Hours BASE SAS PART - I Introduction To Sas System & Architecture History And Various Modules Features Variables & Sas Syntax Rules Sas Data Sets Data Set Options Operators
More informationPharmaSUG 2013 CC26 Automating the Labeling of X- Axis Sanjiv Ramalingam, Vertex Pharmaceuticals, Inc., Cambridge, MA
PharmaSUG 2013 CC26 Automating the Labeling of X- Axis Sanjiv Ramalingam, Vertex Pharmaceuticals, Inc., Cambridge, MA ABSTRACT Labeling of the X-axis usually involves a tedious axis statement specifying
More informationA SAS and Java Application for Reporting Clinical Trial Data. Kevin Kane MSc Infoworks (Data Handling) Limited
A SAS and Java Application for Reporting Clinical Trial Data Kevin Kane MSc Infoworks (Data Handling) Limited Reporting Clinical Trials Is Resource Intensive! Reporting a clinical trial program for a new
More informationHash Objects for Everyone
SESUG 2015 Paper BB-83 Hash Objects for Everyone Jack Hall, OptumInsight ABSTRACT The introduction of Hash Objects into the SAS toolbag gives programmers a powerful way to improve performance, especially
More informationLet SAS Write and Execute Your Data-Driven SAS Code
Let SAS Write and Execute Your Data-Driven SAS Code Kathy Hardis Fraeman, United BioSource Corporation, Bethesda, MD ABSTRACT Some SAS programming statements are based on specific values of data, such
More informationCover the Basics, Tool for structuring data checking with SAS Ole Zester, Novo Nordisk, Denmark
ABSTRACT PharmaSUG 2014 - Paper IB04 Cover the Basics, Tool for structuring data checking with SAS Ole Zester, Novo Nordisk, Denmark Data Cleaning and checking are essential parts of the Stat programmer
More informationPaper An Automated Reporting Macro to Create Cell Index An Enhanced Revisit. Shi-Tao Yeh, GlaxoSmithKline, King of Prussia, PA
ABSTRACT Paper 236-28 An Automated Reporting Macro to Create Cell Index An Enhanced Revisit When generating tables from SAS PROC TABULATE or PROC REPORT to summarize data, sometimes it is necessary to
More informationTackling Unique Problems Using TWO SET Statements in ONE DATA Step. Ben Cochran, The Bedford Group, Raleigh, NC
MWSUG 2017 - Paper BB114 Tackling Unique Problems Using TWO SET Statements in ONE DATA Step Ben Cochran, The Bedford Group, Raleigh, NC ABSTRACT This paper illustrates solving many problems by creatively
More informationSTEP 1 - /*******************************/ /* Manipulate the data files */ /*******************************/ <<SAS DATA statements>>
Generalized Report Programming Techniques Using Data-Driven SAS Code Kathy Hardis Fraeman, A.K. Analytic Programming, L.L.C., Olney, MD Karen G. Malley, Malley Research Programming, Inc., Rockville, MD
More informationCorrecting for natural time lag bias in non-participants in pre-post intervention evaluation studies
Correcting for natural time lag bias in non-participants in pre-post intervention evaluation studies Gandhi R Bhattarai PhD, OptumInsight, Rocky Hill, CT ABSTRACT Measuring the change in outcomes between
More informationAn Efficient Method to Create Titles for Multiple Clinical Reports Using Proc Format within A Do Loop Youying Yu, PharmaNet/i3, West Chester, Ohio
PharmaSUG 2012 - Paper CC12 An Efficient Method to Create Titles for Multiple Clinical Reports Using Proc Format within A Do Loop Youying Yu, PharmaNet/i3, West Chester, Ohio ABSTRACT Do you know how to
More informationKEYWORDS Metadata, macro language, CALL EXECUTE, %NRSTR, %TSLIT
MWSUG 2017 - Paper BB15 Building Intelligent Macros: Driving a Variable Parameter System with Metadata Arthur L. Carpenter, California Occidental Consultants, Anchorage, Alaska ABSTRACT When faced with
More informationCFB: A Programming Pattern for Creating Change from Baseline Datasets Lei Zhang, Celgene Corporation, Summit, NJ
Paper TT13 CFB: A Programming Pattern for Creating Change from Baseline Datasets Lei Zhang, Celgene Corporation, Summit, NJ ABSTRACT In many clinical studies, Change from Baseline analysis is frequently
More informationUsing V9 ODS LAYOUT to Simplify Generation of Individual Case Summaries Ling Y. Chen, Rho, Inc., Newton, MA
Paper PO02 Using V9 ODS LAYOUT to Simplify Generation of Individual Case Summaries Ling Y. Chen, Rho, Inc., Newton, MA ABSTRACT Up until now, individual case summaries involve complicated data _null_ coding
More informationABSTRACT MORE THAN SYNTAX ORGANIZE YOUR WORK THE SAS ENTERPRISE GUIDE PROJECT. Paper 50-30
Paper 50-30 The New World of SAS : Programming with SAS Enterprise Guide Chris Hemedinger, SAS Institute Inc., Cary, NC Stephen McDaniel, SAS Institute Inc., Cary, NC ABSTRACT SAS Enterprise Guide (with
More informationSa file of normal ranges can be
* Overcoming Kainophobia : Replacing Complex Merges with PROC SQL Brenda M Barber, Quintiles, Inc, Research Triangle Park, NC Abstract here are many instances in working with data from clinical trials
More informationPROC REPORT Basics: Getting Started with the Primary Statements
Paper HOW07 PROC REPORT Basics: Getting Started with the Primary Statements Arthur L. Carpenter California Occidental Consultants, Oceanside, California ABSTRACT The presentation of data is an essential
More information