Instant Interactive SAS Log Window Analyzer



Similar documents
Using Pharmacovigilance Reporting System to Generate Ad-hoc Reports

Enhancing the SAS Enhanced Editor with Toolbar Customizations Lynn Mullins, PPD, Cincinnati, Ohio

How To Write A Clinical Trial In Sas

PharmaSUG Paper QT26

Introduction to the Agency Portal

Paper FF-014. Tips for Moving to SAS Enterprise Guide on Unix Patricia Hettinger, Consultant, Oak Brook, IL

Internet Explorer 7. Getting Started The Internet Explorer Window. Tabs NEW! Working with the Tab Row. Microsoft QUICK Source

NetClient CS Document Management Portal User Guide. version 9.x

Identifying Bid Opportunities

AN ANIMATED GUIDE: SENDING SAS FILE TO EXCEL

IBM i Version 7.2. Systems management Advanced job scheduler

SUGI 29 Applications Development

A Method for Cleaning Clinical Trial Analysis Data Sets

Counting the Ways to Count in SAS. Imelda C. Go, South Carolina Department of Education, Columbia, SC

Automation of Large SAS Processes with and Text Message Notification Seva Kumar, JPMorgan Chase, Seattle, WA

A Macro to Create Data Definition Documents

SUGI 29 Coders' Corner

We begin by defining a few user-supplied parameters, to make the code transferable between various projects.

The Query Builder: The Swiss Army Knife of SAS Enterprise Guide

Post Processing Macro in Clinical Data Reporting Niraj J. Pandya

What's New in ADP Reporting?

3 IDE (Integrated Development Environment)

Essential Project Management Reports in Clinical Development Nalin Tikoo, BioMarin Pharmaceutical Inc., Novato, CA

An macro: Exploring metadata EG and user credentials in Linux to automate notifications Jason Baucom, Ateb Inc.

Labels, Labels, and More Labels Stephanie R. Thompson, Rochester Institute of Technology, Rochester, NY

How to test and debug an ASP.NET application

SAS/Data Integration Studio Creating and Using A Generated Transformation Jeff Dyson, Financial Risk Group, Cary, NC

Evaluator s Guide. PC-Duo Enterprise HelpDesk v5.0. Copyright 2006 Vector Networks Ltd and MetaQuest Software Inc. All rights reserved.

Importing Excel File using Microsoft Access in SAS Ajay Gupta, PPD Inc, Morrisville, NC

ing Automated Notification of Errors in a Batch SAS Program Julie Kilburn, City of Hope, Duarte, CA Rebecca Ottesen, City of Hope, Duarte, CA

Using SQL Server Management Studio

1. Base Programming. GIORGIO RUSSOLILLO - Cours de prépara+on à la cer+fica+on SAS «Base Programming»

Asset Track Getting Started Guide. An Introduction to Asset Track

Data Presentation. Paper Using SAS Macros to Create Automated Excel Reports Containing Tables, Charts and Graphs

Lab 2 - CMPS 1043, Computer Science I Introduction to File Input/Output (I/O) Projects and Solutions (C++)

ABSTRACT INTRODUCTION SESUG Paper PO-08

State of Florida eportal. Law Firm Administrator Documentation

EXTRACTING DATA FROM PDF FILES

PharmaSUG Paper AD11

The Power of CALL SYMPUT DATA Step Interface by Examples Yunchao (Susan) Tian, Social & Scientific Systems, Inc., Silver Spring, MD

Excel Reports and Macros

IBM Information Server

This web-based report provides information for single funds centers. The report can be run for one funds center or multiple single funds centers.

WNMS Mobile Application

Automating SAS Macros: Run SAS Code when the Data is Available and a Target Date Reached.

Search and Replace in SAS Data Sets thru GUI

Smart Web. User Guide. Amcom Software, Inc.

I Didn t Know SAS Enterprise Guide Could Do That!

JAMS 6.X Client Features 3. Working with Jobs 4-5. Submitting Jobs Manually 6-7. Working with Setups 8-9. Working with Views 10-14

From The Little SAS Book, Fifth Edition. Full book available for purchase here.

DiskPulse DISK CHANGE MONITOR

User s Guide for the Texas Assessment Management System

9/4/2012. Objectives Microsoft Word Illustrated. Unit B: Editing Documents. Objectives (continued) Cutting and Pasting Text

Quick Start to Data Analysis with SAS Table of Contents. Chapter 1 Introduction 1. Chapter 2 SAS Programming Concepts 7

Resource database input tool: Create new resource or a new event process

Simulate PRELOADFMT Option in PROC FREQ Ajay Gupta, PPD, Morrisville, NC

Mikogo User Guide Linux Version

Electronic Invoicing. InvoiceWorks Supplier User Guide For Atlas Air

CMU/SCS Computing Facilities. Microsoft Outlook 2010 Calendar Guide

Using Macros to Automate SAS Processing Kari Richardson, SAS Institute, Cary, NC Eric Rossland, SAS Institute, Dallas, TX

CHAPTER 6: SEARCHING AN ONLINE DATABASE

Cognos BI Getting Started

Upon Installation, Soda

MS WORD 2007 (PC) Macros and Track Changes Please note the latest Macintosh version of MS Word does not have Macros.

Basic Navigation. User Guide

Reporting Student Progress and Achievement

Getting Started The Windows SharePoint Services Window

Terminal 4 Site Manager User Guide. Need help? Call the ITD Lab, x7471

Training Manual. Version 6

Wakanda Studio Features

Task Scheduler. Morgan N. Sandquist Developer: Gary Meyer Reviewer: Lauri Watts

Word 2010: Mail Merge to with Attachments

Creating Dynamic Reports Using Data Exchange to Excel

Database migration using Wizard, Studio and Commander. Based on migration from Oracle to PostgreSQL (Greenplum)

Appendix K Introduction to Microsoft Visual C++ 6.0

Witango Application Server 6. Installation Guide for Windows

You can access OneDrive through your Office 365 account at

Net Protector Admin Console

ithenticate User Manual

Microsoft Word Quick Reference Guide. Union Institute & University

Petrel TIPS&TRICKS from SCM

Products that are referred to in this document may be trademarks and/or registered trademarks of the respective owners.

Switching from PC SAS to SAS Enterprise Guide Zhengxin (Cindy) Yang, inventiv Health Clinical, Princeton, NJ

Microsoft Office Live Meeting Events User s Guide

Downloading <Jumping PRO> from Page 2

WESSL-2 Script Builder Reference Guide

Business Portal for Microsoft Dynamics GP User s Guide Release 5.1

Auditing UML Models. This booklet explains the Auditing feature of Enterprise Architect. Copyright Sparx Systems Pty Ltd

The entire SAS code for the %CHK_MISSING macro is in the Appendix. The full macro specification is listed as follows: %chk_missing(indsn=, outdsn= );

PharmaSUG 2014 Paper CC23. Need to Review or Deliver Outputs on a Rolling Basis? Just Apply the Filter! Tom Santopoli, Accenture, Berwyn, PA

Stored Documents and the FileCabinet

Lead Management System

Display Options in Transaction SE16

Kaspersky Password Manager USER GUIDE

ithenticate User Manual

Users Guide. FTP/400 File Transfer API and Remote Command Server Version By RJS Software Systems, Inc.

Creating a Participants Mailing and/or Contact List:

Oh No, a Zero Row: 5 Ways to Summarize Absolutely Nothing

B) Mean Function: This function returns the arithmetic mean (average) and ignores the missing value. E.G: Var=MEAN (var1, var2, var3 varn);

Transcription:

ABSTRACT Paper 10240-2016 Instant Interactive SAS Log Window Analyzer Palanisamy Mohan, ICON Clinical Research India Pvt Ltd Amarnath Vijayarangan, Emmes Services Pvt Ltd, India An interactive SAS environment is preferred for developing programs as it gives the flexibility of instantly viewing programming log in the Log window. The programmer must review the log window to ensure that each and every single line of a written program is running successfully without displaying any messages defined by SAS that are potential errors. The number of lines generated in the log window varies depending on the complexity of the program. Reviewing the log window every time is not only time consuming but also prone to manual error for any level of programmer. Even to confirm that the log is free from error, the programmer must check the log. Currently in the interactive SAS environment there is no way to get an instant notification about the generated log from the Log window, indicating whether there have been any messages defined by SAS that are potential errors. This paper introduces an instant approach to analyze the Log window using the SAS macro %ICHECK that displays the report instantly in the same SAS environment. INTRODUCTION The successful programming development is ensured when the log is free from the potential messages. Updating the programs and reviewing the log in the Log window is a to and fro process. As the program grows, the number of lines reported in the log window increases and becomes time consuming task to go through the log. There are plenty of concepts to analyze the log when they are available as a file but this paper introduces a new approach to analyze the log generated in the Log window rather than a file. The SAS macro %ICHECK generates a report in a separate window using %WINDOW and DM statement with the summary of all the SAS defined messages that are potential to error. The programmer does not have to add %ICHECK at the end of the program. Whether a single statement, DATA step, PROC step, or the whole program is submitted, the %ICHECK macro is automatically executed at the end of every submission. It might be surprising to you how a compiled macro can be executed without calling them in the Editor window. But it is possible with the %ICHECK and is developed using Base SAS product. SIMILAR FUNCTIONALITY SAS Enterprise Guide When a program is submitted in SAS Enterprise Guide, the program editor tab shows X mark if there are any errors in the execution as shown below and red mark gets your attention immediately. Display 1. SAS Enterprise Guide Editor and Log Tabs SAS Studio 1

SAS Studio is a developmental web application for SAS that you access through your web browser. It also has the functionally of summarizing the log messages as follows: Display 2. SAS Studio Editor and Log tabs Base SAS Currently there is no option in Base SAS to indicate the execution status like SAS Enterprise Guide or provides the summary of the log like SAS Studio. The proposed approach combines the functionality of SAS Enterprise Guide and SAS Studio using the %ICHECK macro. The %ICHECK generates the reports in two types of custom windows. When the log is free from potential messages, the report window named as FREELOG is displayed in green color with the message LOG IS FREE FROM POTENTIAL MESSAGES Display 3. FREELOG Window The second type of window is generated as follows with the name WARNLOG in greenish-blue color when there is any potential messages occurred in the log. 2

The WARNLOG window has the following information: LINE #: The first occurrence of the corresponding issue type ISSUE TYPE: Provides the name of the potential messages in a short form which is self explainable FREQUENCY: How many times the corresponding issue type occurred in the log In addition to the above three columns there are two footnotes provided at the right bottom of the report. It provides the total number of lines in the log. This can be connected with the LINE # column to get the sense of the first occurrence of the corresponding issue type. Display 4. WARNLOG Window SETTING %ICHECK TO RUN AT THE END OF EVERY EXECUTION While developing the programs adding %ICHECK macro call at the end of the every submission is not easy and not advisable to do. This was the challenge initially when the %ICHECK macro was developed. Later, this problem was addressed by making use of Editor Abbreviations and Key definitions. The process flow to set up %ICHECK is explained as follows. 3

Step 1 One time set up Add %icheck macro program using program editor abbreviations Step 2 One time set up Define a key (F8) to Clear log and output Run SAS program Call %icheck using gsubmit Step 3 Execute a SAS program from editor window using F8 %icheck reviews the log and reports in separate window Display 5. Process Flow SAS PROGRAM EDITOR ABBREVIATIONS The proposed approach utilizes the Editor Abbreviations method to quickly get the %ICHECK macro in the editor window. It is a method to retrieve the text(s) that are stored using a particular keyword. Otherwise, every time it requires some effort to compile the macro from a folder or to add it in setup/auto execution file if allowed. The macro %ICHECK is stored with a keyword icheck as shown below: Display 6. Add Abbreviation The %ICHECK macro can be easily called in Editor Window and compiled with keyword icheck as shown below: Display 7. Macro Call %icheck 4

KEY DEFINITION SAS provides plenty of options to customize the shortcut keys to ease your work. Use any desired key and assign the below commands: Clear Log; Clear Out; submit; gsubmit %icheck ; The command GSUBMIT is used to submit SAS code stored on the clipboard. For the illustration purpose, F8 key is used as shown below. Display 8. Display Manager Keys %CHECK MACRO The skeleton of the %ICHECK macro is explained as follows in a simple way. Read in Log window Save log window content into a temporary file Read in temporary file for potential messages Processing of potential messages Create flag variable if messages are present Identify and count the occurrences of the messages Reporting Designing of %window Reporting using %display Display 9. Execution flow 5

CONCLUSION The proposed solution is developed only using Base SAS product and SAS programming. It can be used in a Windows or UNIX interactive SAS environment without requiring any user inputs. With the proposed approach, there is a significant benefit in the log review process and 100% time saving when log is free from potential messages and 0% chances for any potential messages to be over looked for all levels of programmers. Similar functionality can also be introduced in the Base SAS product itself. CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: Palanisamy Mohan, ICON Clinical Research India Pvt Ltd, Palanisamy.Mohan@iconplc.com palanisas@gmail.com Amarnath Vijayarangan Emmes Services Pvt Ltd, Bangalore, India avijayarangan@emmes.com amarnath7@gmail.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. Other brand and product names are trademarks of their respective companies. APPENDIX %macro icheck; ***Identify the path of WORK library ; %let wpath= %sysfunc(pathname(work)); dm 'log; file "&wpath/icheck.log" replace'; dm "log; "; data icheck; length IssueType txt $ 100; infile "&wpath/icheck.log" length=len lrecl=32000 ; input SystemMessage $varying2000. len ; IssueType=''; SystemMessage=upcase(SystemMessage); if strip(substr(systemmessage,1,5))='error' then IssueType='ERROR'; if strip(substr(systemmessage,1,7))='warning' then IssueType='WARNING'; if scan(systemmessage,1,':')='note' then do; if index(systemmessage,'uninitialized') then IssueType='UNINITIALIZED'; if index(systemmessage,'missing') then IssueType='MISSING'; if index(systemmessage,'character VALUES HAVE BEEN') then IssueType='CHAR2NUM'; if index(systemmessage,'numeric VALUES HAVE BEEN') then IssueType='NUM2CHAR'; if index(systemmessage,'invalid DATA FOR') then IssueType='INVALIDDATA'; if index(systemmessage,'merge STATEMENT HAS MORE THAN') then IssueType='MERGE'; if index(systemmessage,'note: DIVISION BY ZERO DETECTED') then IssueType='DIVISIONBY0'; if index(systemmessage,'extraneous INFORMATION') then IssueType='EXTRANEOUS'; if index(systemmessage,'w.d FORMAT') then IssueType='WDFORMAT'; if index(systemmessage,'repeats OF BY VALUES') then IssueType='REPEATS'; if index(systemmessage,'mathematical OPERATIONS COULD NOT') then IssueType='MATHSOPER'; if index(systemmessage,'interactivity DISABLED WITH') then IssueType='INTERACTIVITY'; if index(systemmessage,'no OBSERVATION') then IssueType='NOOBSERVATION'; if index(systemmessage,'lost CARD') then IssueType='LOSTCARD'; if index(systemmessage,'sas SYSTEM STOPPED PROCESSING') then IssueType='SASSTOPPED'; end; txt=strip(issuetype); lineno+1; call symputx('lastlineno',lineno); if IssueType^=''; keep IssueType lineno SystemMessage Txt ; proc sort data=icheck out=firstoccur; by IssueType lineno; data FirstOccur; set FirstOccur; by IssueType lineno; if first.issuetype; keep IssueType lineno; 6

*** Delete temproary files; %macro fdel(file=); %let rc= %sysfunc(filename(fref,&file)); %let rc= %sysfunc(fdelete(&fref)); %mend; *** Delete the temprorary created log file; %fdel(file=&wpath/icheck.log); proc freq data=icheck noprint; tables IssueType*txt /out=icheck_cnt(drop=percent); data icheck_cnt; merge icheck_cnt FirstOccur; by IssueType; proc sort data=icheck_cnt; by lineno; %let FreeLog=0; data _null_; set icheck_cnt; call symputx('freelog',_n_); %put &FreeLog ; %if &FreeLog=0 %then %do; %window FreeLog color=green #20 @20 '****************************************************************' color=grey #21 @20 '*** ***' color=grey #22 @20 '*** ***' color=grey #23 @20 '*** ***' color=grey #24 @20 '*** ***' color=grey #25 @20 '***' color=grey @35 'LOG IS FREE FROM POTENTIAL MESSAGES' color=white @81 '***' color=grey #26 @20 '*** ***' color=grey #27 @20 '*** ***' color=grey #28 @20 '*** ***' color=grey #29 @20 '*** ***' color=grey #30 @20 '****************************************************************' color=grey ; %display FreeLog ; %end; %if &FreeLog^=0 %then %do; data test; set icheck_cnt end=eol; retain id 6; id+3; string="#" strip(put(id,best.)) " @27 '" cats(lineno) "' @40 '" strip(txt) "' #" strip(put(id,best.)) " @74 " "'" cats(count) "'"; file "&wpath/icheck.txt"; if _n_=1 then do; put '%window WarnLog color=cyan'; put '#4 @35 "LOG IS HAVING POTENTIAL MESSAGES" a=highlight color=red a=underline'; put '#7 @25 "LINE # " a=highlight color=blue a=underline'; put '#7 @40 "ISSUE TYPE" a=highlight color=blue a=underline'; put '#7 @70 "FREQUENCY" a=highlight color=blue a=underline'; end; put string 'a=highlight color=black'; if eol then do; string="#" strip(put(id+5,best.)) " @1 'Total Number of Lines from LOG = &lastlineno' a=highlight color=green"; put string; string="#" strip(put(id+7,best.)) " @1 '# :Indicates the First Cccurrence of the Corresponding ISSUE TYPE' a=highlight color=green"; put string; put ';'; put '%display WarnLog;'; end; %include "&wpath/icheck.txt"; %fdel(file=&wpath/icheck.txt); %end; %mend icheck; 7