Lisa Mendez, PhD & Andrew Kuligowski

Slides:



Advertisements
Similar presentations
SmartConnect Integrations
Advertisements

© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 2Managing and Integrating Data and the Excel Environment Chapter 7Automating Repetitive Tasks.
Copyright © 2008 Pearson Prentice Hall. All rights reserved Copyright © 2008 Prentice-Hall. All rights reserved. Committed to Shaping the Next.
Digital Workbooks Options and Guide. Microsoft Office - Publisher If you use PC’s rather than Macs then ‘Publisher’ is part of the Microsoft Office Software.
Statistics in Science  Introducing SAS ® software Acknowlegements to David Williams Caroline Brophy.
Preforming Mail Merges Lesson 11 © 2014, John Wiley & Sons, Inc. Microsoft Official Academic Course, Microsoft Word Microsoft Word 2013.
Understanding SAS Data Step Processing Alan C. Elliott stattutorials.com.
Data Transformation for Analysis Purposes Presented By: Gregg Ravenscroft Khulisa Management Services
1 “Establish immediately a mechanism, including an internet website, through which a resident of, or small business in, any State may identify affordable.
Copyright © 2006, SAS Institute Inc. All rights reserved. What Is New in SAS Profitability Management (PrM) 2.1? Authors: Jack Zhang Solution & Version:
Microsoft Office 2003: Advanced 1 ADVANCED MICROSOFT ACCESS Lesson 17 – Utilizing Advanced Management Tools.
Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010.
AUTOMATION OF WEB-FORM CREATION - KINNERA ANGADI – MS FINAL DEFENSE GUIDANCE BY – DR. DANIEL ANDRESEN.
A Comparison of SAS versus Microsoft Excel and Access’s Inbuilt VBA Functionality Jozef Tarrant, Amadeus Software Ltd. 1 Copyright © 2011 Amadeus Software.
Computer Science & Engineering 2111 Lecture 9 Data Validation, Worksheet Protection, and Macros 1CSE Data Validation and Macros.
1 Back Up with Each Submit One approach for keeping a dynamic back up copy of your current work.
Bringing Data into SAS From Menu: –File –Import Data –Spreadsheet example first Pick file by browsing Select Library and Member (we will talk about this.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Microsoft Excel – Pivot Tables Introduction to Microsoft Excel Pivot tables Please login to the computers and launch Microsoft Excel. Rob Jones Room WG43.
DAY 21: ACCESS CHAPTER 6 & 7 Tazin Afrin October 31,
Do not put content on the brand signature area NOBS for Noobs David B. Horvath, CCP, MS PhilaSUG Winter 2015 Meeting NOBS for Noobs.
1 EPIB 698C Lecture 1 Instructor: Raul Cruz-Cano
Based on Learning SAS by Example: A Programmer’s Guide Chapters 1 & 2
Online Programming| Online Training| Real Time Projects | Certifications |Online Classes| Corporate Training |Jobs| CONTACT US: STANSYS SOFTWARE SOLUTIONS.
Copyright 2009 The Little Engine That Could: Using EXCEL LIBNAME Engine Options to Enhance Data Transfers between SAS® and Microsoft® Excel Files William.
Finance Business Solutions – User Support & Training
Build your Metadata with PROC CONTENTS and ODS OUTPUT Louise S. Hadden Abt Associates Inc.
Better Metadata Through SAS® II: %SYSFUNC, PROC DATASETS, and Dictionary Tables.
SQL Server Tasks and Components from CozyRoc
ACAP Online Application Process
IMPACT SAMR Cover Sheet
Chapter 10: Accessing Relational Databases (Self-Study)
Tips for Mastering Relational Databases Using SAS/ACCESS®
Preforming Mail Merges
Anti-Money laundering Solution
Importing Enhancements
Using ODS Excel Migrating from DDE to ODS
The Voluntary Pre-K Application in ePlan
Spreadsheet-Based Decision Support Systems
Performing Mail Merges
Innovative Technology Solutions
Good Morning  Please be sure to take care of your belongings.
SAS Programming Introduction to SAS.
Mail Merge Instructions (Yanick’s Version)
Preforming Mail Merges
Dynamic Data Flows in SSIS without ProgramminG
SAS Programming I Matthew A. Lanham Doctoral Student
Dynamic Data Flows in SSIS without ProgramminG
Lesson 1: Introduction to Trifacta Wrangler
3 Macro Storage.
Chapter 1: Introduction to SAS
Mental Health Data Alliance, LLC (MHData) June 7th , 2018
Fall 2017 Questions and Answers (Q&A)
Data Validation, Worksheet Protection, and Macros
Programming Logic and Design Fourth Edition, Comprehensive
Dynamic Data Flows in SSIS without ProgramminG
Introduction to SAS A SAS program is a list of SAS statements executed in order Every SAS statement ends with a semicolon! SAS statements can be in caps.
Beautiful PROC CONTENTS Output Using the ODS Excel Destination
Program Testing and Performance
Author: Kaiqing Fan Company: Mastech Digital Inc.
Never Cut and Paste Again
Trigger %macro check_trigger_run;
Passing Simple and Complex Parameters In and Out of Macros
IMPORTING DATA WITH DDE (Dynamic Data Exchange) Or Proc Import?
Automated Testing Strategies and Dynamics 365 Performance Management
Chapter 11: Exception Handling
Templates Create and Use
Hire Xpress User’s Training A Human Resources guide to Hire Xpress
The Taxidermy Studio of Alfred Giles
Presentation transcript:

Lisa Mendez, PhD & Andrew Kuligowski Case Study: Using Base SAS® to Automate Quality Checks of Excel ® Workbooks that have Multiple Worksheets Lisa Mendez, PhD & Andrew Kuligowski

Overview The Process Determine how to identify the smaller problems within the larger, overwhelming problem Solve each problem using SAS code Implementing the code Lessons learned

Background Unfamiliar with the data – thrown into the deep end There were 5 markets ADHD, BNZD, CNNB, CDNE, and PAIN Each market had 7 Excel Workbooks that needed to be checked Each Workbook had various multiple worksheets ADHD – 7 worksheets BNZD – 24 worksheets CNNB – 7 worksheets CDNE – 5 worksheets PAIN – 55 worksheets

The Overarching Problem Let’s do the math! 5 markets multiplied by 7 workbooks (35 workbooks) that had a total of 98 workbooks that needed to be checked That’s 3,430 worksheets FOR 27 QUARTERS!!!!! For a grand total of 92,610 worksheets That can be just a little overwhelming…

Getting the Data into SAS® XLSX Engine Allows you to read and write Microsoft Excel files as if they were data sets in a library Advantage is that it accesses the XLSX file directly - does not use the Microsoft data APIs as a go-between You have to have a license for SAS/ACCESS to PC Files to utilize the XLSX engine SAS University Edition, the SAS/ACCESS product is part of the that package libname Cadhd1 XLSX "C:\Users\lmendez\Documents\RMPDC\Deliverables2017_Q2\ADHD\RMPD_Patient Tracking_ADHD_NDW_2018Q2.xlsx";

Getting the Data into SAS® libname Cadhd1 XLSX "C:\Users\lmendez\Documents\RMPDC\Deliverables2017_Q2\ ADHD\RMPD_Patient Tracking_ADHD_NDW_2018Q2.xlsx"; The libname statement sets up the datasets, and you will see them in the cadhd1 library, but the datasets will be empty Names of datasets are the names of the worksheets

Loading the Data Using PROC SQL & SAS Dictionary tables

Loading the Data Note: All Caps where libname="CADHD1"

Loading the Data

Loading the Data

Loading the Data Macro variables (will be used in the macro) Output from the log: 52 53 %put &snamlist_1; /* show the macro variable snamlist in the log */ LOOKUP*STATE_SUBGRP*STATE_SUPERGRP*ZIP_SUBGRP_AMPH*ZIP_SUBGRP_METH*ZIP_SUBGRP_OTH_ANAL*ZIP_SUBGRP_OTH_ANTI*ZIP_SUPER 54 %put &n_1; /* show the macro variable n_1 I the log */ 8

Loading the Data SAS Macro 54 %put &n_1; /* show the macro variable n_1 I the log */ 8 LOOKUP*STATE_SUBGRP*STATE_SUPERGRP*ZIP_SUBGRP_AMPH*ZIP_SUBGRP_METH*ZIP_SUBGRP_OTH_ANAL*ZIP_SUBGRP_OTH_ANTI*ZIP_SUPER

Validating Worksheet & Variable Names Need templates to compare Load templates each quarter Ensure permanent template library (libname statement) By Market List of variable names List of worksheet names

Validating Worksheet Names Once templates are loaded, compare worksheet names

Validating Worksheet Names Dataset created after PROC SQL compare for Worksheet Names All worksheet names match – no errors

Validating Worksheet Names Create an error report

Validating Variable Names Once templates are loaded, compare variable names Use Proc Contents to get a current list variable names

Validating Worksheet & Variable Names Dataset created after PROC SQL compare for Variable Names Everything Matches Note: change variable names either before PROC SQL, or in the PROC SQL statement

Exporting Error Report to Excel® The macro variable ‘x’ is used to number the reports that correspond with each workbook

Exporting Error Report to Excel® Used within a macro One Excel file per Market Multiple worksheets for each workbook checked No errors for this workbook Each worksheet corresponds to a workbook

Exporting Error Report to Excel® Sample of worksheet error

Exporting Error Report to Excel® Lessons learned: Do not output if there are no errors, or output “no error” message, because most of the workbooks do not have variable name or worksheet name errors

Validating Data A macro variable was created, using the same methods as before for all the worksheet/dataset names The macro variable was used in conjunction with a macro to execute a data step multiple times to check all the data within a worksheet/dataset

Validating Data

Validating Data Similar code was written to check the products within a workbook A pre-loaded template was used to ensure the correct products were in the correct worksheet/dataset A macro was used, along with a data step, and a PROC SQL step to compare product names in the pre-loaded template with the product names of the current data

Validating Data An exception report was created for the values check Utilized lesson learned from previous Excel export For these exception reports, only MS Excel workbooks were created for each worksheet only if any errors were found

Exporting Error Report to Excel®

Exporting Error Report to Excel®

Deleting Datasets Many macros are used to create many datasets in the process of checking one workbook To ensure there is enough space in the SAS session, PROC Datasets is used to clean up the libraries used in the program

Deleting Datasets To delete all files in a SAS data library at one time use the KILL option  CAUTION: The KILL option deletes all members of the library immediately after the statement is submitted

Conclusion When faced with overwhelming task break it down Solve one problem at a time Doing research online may help provide different solutions Find one that works for your problem, and YOU prefer Don’t be afraid to code your program and do some steps that are not as efficient (“down and dirty”) When utilizing macros, get the program to work before coding the macro(s) Enhance your program for efficiency when you have more time

Contact Information Name: Lisa Mendez Company: IQVIA GS Email: mendezla@sbcglobal.net Name: Andrew Kuligowski Company: HSN Email: kuligowskiconference@gmail.com