Cleaning up your SAS log: Note Messages

Similar documents
Creating and Executing Stored Compiled DATA Step Programs

Using Proc Freq for Manageable Data Summarization

Omitting Records with Invalid Default Values

Automation of makefile For Use in Clinical Development Nalin Tikoo, BioMarin Pharmaceutical Inc., Novato, CA

Making the most of SAS Jobs in LSAF

Automation of SDTM Programming in Oncology Disease Response Domain Yiwen Wang, Yu Cheng, Ju Chen Eli Lilly and Company, China

The Three I s of SAS Log Messages, IMPORTANT, INTERESTING, and IRRELEVANT William E Benjamin Jr, Owl Computer Consultancy, LLC, Phoenix AZ.

Lecture 1 Getting Started with SAS

Not Just Merge - Complex Derivation Made Easy by Hash Object

Optimizing System Performance

SAS Clinical Data Integration 2.4

SAS File Management. Improving Performance CHAPTER 37

SAS Viewer giving way to Universal Viewer Steve Wright, Quintiles, RTP, NC

Combining Contiguous Events and Calculating Duration in Kaplan-Meier Analysis Using a Single Data Step

Checking for Duplicates Wendi L. Wright

PharmaSUG Paper TT11

PharmaSUG Paper IB11

When ANY Function Will Just NOT Do

Reducing SAS Dataset Merges with Data Driven Formats

Performance Considerations

Application Interface for executing a batch of SAS Programs and Checking Logs Sneha Sarmukadam, inventiv Health Clinical, Pune, India

Programming Gems that are worth learning SQL for! Pamela L. Reading, Rho, Inc., Chapel Hill, NC

Debugging 101 Peter Knapp U.S. Department of Commerce

Data Set Options. Specify a data set option in parentheses after a SAS data set name. To specify several data set options, separate them with spaces.

A Utility Program for Quickly Identifying LOG Error or Warning Messages

Paper HOW-06. Tricia Aanderud, And Data Inc, Raleigh, NC

Tackling Unique Problems Using TWO SET Statements in ONE DATA Step. Ben Cochran, The Bedford Group, Raleigh, NC

BASICS BEFORE STARTING SAS DATAWAREHOSING Concepts What is ETL ETL Concepts What is OLAP SAS. What is SAS History of SAS Modules available SAS

Pruning the SASLOG Digging into the Roots of NOTEs, WARNINGs, and ERRORs

Creating an ADaM Data Set for Correlation Analyses

Harmonizing CDISC Data Standards across Companies: A Practical Overview with Examples

9 Ways to Join Two Datasets David Franklin, Independent Consultant, New Hampshire, USA

CHAPTER 7 Examples of Combining Compute Services and Data Transfer Services

A Practical Introduction to SAS Data Integration Studio

Submission-Ready Define.xml Files Using SAS Clinical Data Integration Melissa R. Martinez, SAS Institute, Cary, NC USA

How to Automate Validation with Pinnacle 21 Command Line Interface and SAS

How to validate clinical data more efficiently with SAS Clinical Standards Toolkit

OLAP Drill-through Table Considerations

Using SAS Viya Microservices Logging for Performance Analysis of SAS Visual Analytics 8.1 Reports

SAS Clinical Data Integration 2.6

Please don't Merge without By!!

Using GSUBMIT command to customize the interface in SAS Xin Wang, Fountain Medical Technology Co., ltd, Nanjing, China

Divide and Conquer Writing Parallel SAS Code to Speed Up Your SAS Program

SAS Catalogs. Definition. Catalog Names. Parts of a Catalog Name CHAPTER 32

Uncommon Techniques for Common Variables

Programming Beyond the Basics. Find() the power of Hash - How, Why and When to use the SAS Hash Object John Blackwell

Beginner Beware: Hidden Hazards in SAS Coding

SAS Data Integration Studio 3.3. User s Guide

This Text file. Importing Non-Standard Text Files using and / Operators.

Copyright 2012 Pulse Systems, Inc. Page 1 of 46

Andrew H. Karp Sierra Information Services, Inc. San Francisco, California USA

SDTM Attribute Checking Tool Ellen Xiao, Merck & Co., Inc., Rahway, NJ

Epidemiology Principles of Biostatistics Chapter 3. Introduction to SAS. John Koval

Tweaking your tables: Suppressing superfluous subtotals in PROC TABULATE

Applications Development

Gary L. Katsanis, Blue Cross and Blue Shield of the Rochester Area, Rochester, NY

PharmaSUG Paper PO10

Step through Your DATA Step: Introducing the DATA Step Debugger in SAS Enterprise Guide

SAS Studio: A New Way to Program in SAS

Tasks Menu Reference. Introduction. Data Management APPENDIX 1

Using Data Transfer Services

It s not the Yellow Brick Road but the SAS PC FILES SERVER will take you Down the LIBNAME PATH= to Using the 64-Bit Excel Workbooks.

Paper CT-16 Manage Hierarchical or Associated Data with the RETAIN Statement Alan R. Mann, Independent Consultant, Harpers Ferry, WV

SAS automation techniques specification driven programming for Lab CTC grade derivation and more

Chapter 6 Creating Reports. Chapter Table of Contents

CDISC Variable Mapping and Control Terminology Implementation Made Easy

How Managers and Executives Can Leverage SAS Enterprise Guide

The NESTED Procedure (Chapter)

Paper CC16. William E Benjamin Jr, Owl Computer Consultancy LLC, Phoenix, AZ

Are you Still Afraid of Using Arrays? Let s Explore their Advantages

SAS Environment Manager A SAS Viya Administrator s Swiss Army Knife

Error Trapping Techniques for SCL. Andrew Rosenbaum, Trilogy Consulting, Kalamazoo, MI

Anatomy of a Merge Gone Wrong James Lew, Compu-Stat Consulting, Scarborough, ON, Canada Joshua Horstman, Nested Loop Consulting, Indianapolis, IN, USA

Going Under the Hood: How Does the Macro Processor Really Work?

An Alternate Way to Create the Standard SDTM Domains

An Efficient Solution to Efficacy ADaM Design and Implementation

Clinical Data Visualization using TIBCO Spotfire and SAS

Basic SAS Hash Programming Techniques Applied in Our Daily Work in Clinical Trials Data Analysis

Using a Fillable PDF together with SAS for Questionnaire Data Donald Evans, US Department of the Treasury

Can you decipher the code? If you can, maybe you can break it. Jay Iyengar, Data Systems Consultants LLC, Oak Brook, IL

The Power of Combining Data with the PROC SQL

Remember to always check your simple SAS function code! Yingqiu Yvette Liu, Merck & Co. Inc., North Wales, PA

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

estos UCServer Multiline TAPI Driver

PharmaSUG Paper BB01

Paper Haven't I Seen You Before? An Application of DATA Step HASH for Efficient Complex Event Associations. John Schmitz, Luminare Data LLC

The Dataset Diet How to transform short and fat into long and thin

Quicker Than Merge? Kirby Cossey, Texas State Auditor s Office, Austin, Texas

SESUG 2014 IT-82 SAS-Enterprise Guide for Institutional Research and Other Data Scientists Claudia W. McCann, East Carolina University.

CMISS the SAS Function You May Have Been MISSING Mira Shapiro, Analytic Designers LLC, Bethesda, MD

ABSTRACT INTRODUCTION SIMPLE COMPOSITE VARIABLE REVIEW SESUG Paper IT-06

Paper TT17 An Animated Guide : Speed Merges with Key Merging and the _IORC_ Variable Russ Lavery Contractor for Numeric resources, Inc.

Using the SQL Editor. Overview CHAPTER 11

Data Manipulations Using Arrays and DO Loops Patricia Hall and Jennifer Waller, Medical College of Georgia, Augusta, GA

Storing and Reusing Macros

SAS/STAT 13.1 User s Guide. The NESTED Procedure

If You Need These OBS and These VARS, Then Drop IF, and Keep WHERE Jay Iyengar, Data Systems Consultants LLC

Introduction. LOCK Statement. CHAPTER 11 The LOCK Statement and the LOCK Command

PharmaSUG Paper PO22

A Breeze through SAS options to Enter a Zero-filled row Kajal Tahiliani, ICON Clinical Research, Warrington, PA

Transcription:

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 possibly creating specifications. Your job also includes writing and testing SAS code to produce the final product, whether it is SDTM datasets, ADaM datasets or statistical outputs such as tables, listings or figures. You reach the point where you have completed the initial programming, removed all obvious errors and warnings from your SAS log and checked your outputs for accuracy. You are almost done with your programming task, but one important step remains. It is considered best practice to check your SAS log for any questionable messages generated by the SAS system. In addition to messages that begin with the words WARNING or ERROR, there are also messages that begin with the words NOTE or INFO. This paper will focus on five different types of NOTE messages that commonly appear in the SAS log and will present ways to remove these messages from your log. INTRODUCTION The SAS log is a record of what happens when you run your SAS program and is an essential tool for debugging code. The log includes program statements, as well as messages generated by SAS. These messages can begin with the words WARNING, ERROR, NOTE or INFO. This paper will explore in detail some of the reasons that cause various NOTE messages to appear in the SAS log, and will give suggestions on how to remove these messages from the log, if this is desired. By default, note messages will be printed in the SAS log. In order to have all log messages starting with NOTE: suppressed, use the following option: options nonotes; To return to the default use the following option: options notes; NOTE MESSAGES Some notes are very informative, such as those that tell which version of SAS is being used or those that indicate the dataset name, the number of observations and the number of variables within the dataset. Examples of these and a few other useful notes are listed below: NOTE: SAS (r) Proprietary Software 9.4 (TS1M1) NOTE: The data set WORK.LAB_NEW has 10 observations and 8 variables. NOTE: Libref IN1 was successfully assigned as follows: Engine: V9 Physical Name: S:\SAS\PAPER_2016\TESTDATA NOTE: Compressing data set WORK.LB0 decreased size by 63.34 percent. 1

Compressed is 7626 pages; un-compressed would require 20800 pages. NOTE: PROCEDURE SORT used (Total process time): real time 6.99 seconds cpu time 2.66 seconds NOTE: 0 observations with duplicate key values were deleted. Other notes may be indicative of some problem within your code. Depending on your company s standards, the best practice may be to avoid having certain notes appear in your SAS log. Below are examples of five different types of note messages that you probably want to avoid and some suggestions on how to deal with them. EXAMPLE 1 : MERGE STATEMENT HAS MORE THAN ONE DATA SET WITH REPEATS OF BY VALUES This note should never show up in your SAS log and if it does, you may get unexpected and undesirable results. The code below shows a case where the note is being generated because the datasets are at the SUBJECT and VISIT level, instead of just the SUBJECT level. Once VISIT is added to the merge, the note in question goes away. 2

EXAMPLE 2 : NUMERIC CONVERTED TO CHARACTER OR CHARACTER CONVERTED TO NUMERIC Below is some code showing notes referring to character values being converted to numeric or numeric values being converted to character. This type of note can be removed by using the correct variable type. 3

Taking a look at the dataset contents, it becomes obvious that SUBJID is a numeric variable and that VISIT is a character variable. Once the code is adjusted accordingly, the notes in question no longer appear in the log as shown below. 4

EXAMPLE 3: VARIABLE IS UNINITIALIZED When you see a note in your log referring to an uninitialized variable, this means that the variable does not exist. Often times this is due to a mistake in the variable name that can be easily rectified. If the variable is not created yet, because the spec is not final or because of pending raw data, you might consider leaving the uninitialized message in the production program log, as a reminder that the work is not complete yet. Below is an example of this. The program specifies VISITS, but the variable name is VISIT. 5

EXAMPLE 4: MISSING VALUES WERE GENERATED AS A RESULT OF PERFORMING AN OPERATION ON MISSING VALUES One note that can usually be easily avoided is the note that indicates that missing values are generated as a result of performing an operation on missing values. Below is code where the message appears in the log because there are a few missing birthdates in the dataset and therefore age is missing for those records. Once records with missing birthdates are excluded from the calculations, the note no longer shows up in the log. Age will still be missing for those records. The dataset does not change, but the log is cleaner. 6

EXAMPLE 5: INVALID DATA VALUES Below is some code showing invalid date values. Once records with missing birthdates are excluded from the calculations, the note no longer shows up in the log. Age will still be missing for those records. The dataset does not change, but the log is cleaner. 7

CONCLUSION Hopefully the information provided in this paper will give you some insight into why certain Note messages are appearing in your SAS log and also give you some ideas how to remove them. Having a SAS log that is clean and free of extra messages will help the programmer produce a higher quality final product, whether it is an SDTM dataset, ADaM dataset or a statistical output such as a table, listing or figure. CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: Jennifer Srivastava Quintiles Transnational Corporation 919-749-8567 Jennifer.srivastava@quintiles.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. 8