Scanning The Job Log for Errors & Notes. Devendra Patel, Information Services



Similar documents
CHAPTER 1 Overview of SAS/ACCESS Interface to Relational Databases

Five Little Known, But Highly Valuable, PROC SQL Programming Techniques. a presentation by Kirk Paul Lafler

SAS Drug Development Release Notes 35DRG07

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

SAS Programming Tips, Tricks, and Techniques

SUGI 29 Coders' Corner

How to Use SDTM Definition and ADaM Specifications Documents. to Facilitate SAS Programming

ODBC Client Driver Help Kepware, Inc.

SAS PASSTHRU to Microsoft SQL Server using ODBC Nina L. Werner, Madison, WI

Applications Development ABSTRACT PROGRAM DESIGN INTRODUCTION SAS FEATURES USED

Monitoring Replication

CRMS Quick Training Guide

5. Crea+ng SAS Datasets from external files. GIORGIO RUSSOLILLO - Cours de prépara+on à la cer+fica+on SAS «Base Programming»

SAS 9.4 PC Files Server

Lost in Space? Methodology for a Guided Drill-Through Analysis Out of the Wormhole

WEB BASED Access Control/Time Attendance Software Manual V 1.0

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

How To Write A Clinical Trial In Sas

Using the SQL Procedure

Performing Queries Using PROC SQL (1)

Apparo Fast Edit. Excel data import via 1 / 19

An Introduction to SAS/SHARE, By Example

Site Monitor. Version 5.3

Eliminating Tedium by Building Applications that Use SQL Generated SAS Code Segments

Managing very large EXCEL files using the XLS engine John H. Adams, Boehringer Ingelheim Pharmaceutical, Inc., Ridgefield, CT

Chapter 9 Joining Data from Multiple Tables. Oracle 10g: SQL

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

SAS UNIX-Space Analyzer A handy tool for UNIX SAS Administrators Airaha Chelvakkanthan Manickam, Cognizant Technology Solutions, Teaneck, NJ

Chapter 1 Overview of the SQL Procedure

Using Pharmacovigilance Reporting System to Generate Ad-hoc Reports

TigerTracks Incident Management Customer Guide Revision: 0.2

Big Data, Fast Processing Speeds Kevin McGowan SAS Solutions on Demand, Cary NC

SJC Password Self-Service System FAQ 2012

ODBC Chapter,First Edition

AN INTRODUCTION TO MACRO VARIABLES AND MACRO PROGRAMS Mike S. Zdeb, New York State Department of Health

Performance Tuning for the Teradata Database

SAS Comments How Straightforward Are They? Jacksen Lou, Merck & Co.,, Blue Bell, PA 19422

Trend Micro KASEYA INTEGRATION GUIDE

FileLand User Guide User Guide for CTP Legacy Scanning Service

EVENT VIEWER IN WINDOWS 7

KB Windows 2000 DNS Event Messages 1 Through 1614

ithenticate User Manual

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 USB FLASH DISK WITH TCMS V2

Personal Portfolios on Blackboard

Where Are My Primary Documents?

Analyzing the Server Log

Post Processing Macro in Clinical Data Reporting Niraj J. Pandya

CSSEA Helpdesk User Guide

More Tales from the Help Desk: Solutions for Simple SAS Mistakes Bruce Gilsen, Federal Reserve Board

Note: The where clause of the SUBSET statement is sent "as is" to Oracle, so it must contain correct Oracle syntax.

BackupAgent Management Console User Manual

Oracle Database: Introduction to SQL

NOTE: If you encounter difficulties connecting to CMSNet, contact the CMSNet Help Desk at (888)

White Paper. Blindfolded SQL Injection

Cre-X-Mice Database. User guide

Informatica Corporation Proactive Monitoring for PowerCenter Operations Version 3.0 Release Notes May 2014

A Recursive SAS Macro to Automate Importing Multiple Excel Worksheets into SAS Data Sets

AN ANIMATED GUIDE: SENDING SAS FILE TO EXCEL

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

Oracle Database: Introduction to SQL

SAS Visual Analytics 7.2 for SAS Cloud: Quick-Start Guide

FSD Finance One User Manual Accounts Payable Last update: October 2013

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

Managing the Database and Student Records Online (at the District Level)

IT Service Desk Manual Ver Document Prepared By: IT Department. Page 1 of 12

Turnitin User Guide. Includes GradeMark Integration. January 2014 (revised)

COLLABORATION NAVIGATING CMiC

Using DDE and SAS/Macro for Automated Excel Report Consolidation and Generation

The prerelease version of SQL was called SEQUEL (for Structured English Query Language), and some people still pronounce SQL as sequel.

Retrieving Data from Large DB2 Tables Based on Keys in SAS : The Sequel

Installing, Uninstalling, and Upgrading Service Monitor

Data Access Guide. BusinessObjects 11. Windows and UNIX

DBF Chapter. Note to UNIX and OS/390 Users. Import/Export Facility CHAPTER 7

Security Cooperation Information Portal

Rational Software. Getting Started with Rational Customer Service Online Case Management. Release 1.0

WHAT S NEW 4.5. FileAudit VERSION.

Sync your schedule and work orders with SME & Microsoft Outlook

Getting Started with IntelleView POS Administrator Software

Choosing a Data Model for Your Database

PRV Enrollment Individualized Services Information System (ISIS) Help Desk

Change Color for Export from Light Green to Orange when it Completes with Errors (31297)

Introduction to the Data Migration Framework (DMF) in Microsoft Dynamics WHITEPAPER

ithenticate User Manual

Lesson 07: MS ACCESS - Handout. Introduction to database (30 mins)

INPS Remote Vision MIQUEST Training Manual

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= );

Transcription:

Scanning The Job Log for Errors & Notes Devendra Patel, Information Services

Scanning The Job Log for Errors & Notes Scanning The Job Log A SAS Process: This SAS process is a two-stage process: Create the Job log in a text file and Retrieve the Job log created above and Scan for Error & Warning messages plus Notes. SOURCE CODE From: SUGI 31 Posters NOTE: This source code is provided for the purpose of illustrating the points made in this paper. Readers should be encouraged to evaluate and test this source code thoroughly, before deciding to use it in their own SAS programs. It also uses PROC PRINTTO process.

Scanning The Job Log for Errors & Notes Create the Job log in a text file: SAS program Macros MC_PRINTTO.sas will create the job log file in a specified file folder. SAS program Macros MC_LogCheck.sas will scan the file. Keyword for Scan: 1 ST 5 Characters of line ERROR, WARNI & NOTE: Within Note: There were, Table, Physical Name

Result Log 1. Logfile few lines of log file (RUN_LoadTB_Refresh_07AUG2013.log) NOTE: Libref LIB was successfully assigned as follows: Levels: 1 Engine(1): V9 Physical Name(1): /SAS_data/MSB/Stats_Profiles_Production/Data/CntlTB/System NOTE: Libref SYSLIBTB was successfully assigned as follows: Levels: 1 Engine(1): V9 Physical Name(1): /SAS_data/MSB/Stats_Profiles_Production/Data/CntlTB/System SYMBOLGEN: Macro variable LKUPTBPATH resolves to /SAS_data/MSB/Stats_Profiles_Production/Data/LkupTB/ NOTE: Libref LKUPTB was successfully assigned as follows: Levels: 1 Engine(1): V9 Physical Name(1): /SAS_data/MSB/Stats_Profiles_Production/Data/LkupTB NOTE: The query requires remerging summary statistics back with the original data. NOTE: The query requires remerging summary statistics back with the original data. More log file lines NOTE: The infile LIB_IN is: Filename=/SAS_data/MSB/Stats_Profiles_Production/Data/download/msp_natv_rep.txt, Owner Name=msbmast1,Group Name=msb_stat_prod, Access Permission=rwxrw----, Last Modified=Tue Aug 6 08:01:18 2013, File Size (bytes)=4878126

Result Log NOTE: Invalid data for BYEAR in line 1 38-44. RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0 1 CHAR hsn,band_resc,res_code,post_code,sex,born_yy,born_mm,age. 57 ZONE 676266665767627675666627677566662767266765772667656626660 NUMR 83EC21E4F2533C253F3F45C0F34F3F45C358C2F2EF99C2F2EFDDC175D HSN=hsn,band_ BAND=resc REScode=res_code PostCD=post_cod SEX=sex BYEAR=. BMONTH=born_mm _ERROR_=1 _N_=1 NOTE: 113261 records were read from the infile LIB_IN. The minimum record length was 41. The maximum record length was 57. NOTE: The data set WORK.W_NAT has 113261 observations and 7 variables. More log file lines NOTE: The "<>" operator is interpreted as "not equals". NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE expression. NOTE: A CASE expression has no ELSE clause. Cases not accounted for by the WHEN clauses will result in a missing value for the CASE expression. WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity problem. NOTE: Table LKUPTB.T_DDLOOKUP created, with 8742 rows and 12 columns. More log file lines

3. Notes.txt 3. Notes.txt few lines (RUN_LoadTB_Refresh_07AUG2013_notes.txt) RUN_LoadTB_Refresh NOTE: Libref LIB was successfully assigned as follows: Physical Name(1): /SAS_data/MSB/Stats_Profiles_Production/Data/CntlTB/System NOTE: Libref SYSLIBTB was successfully assigned as follows: Physical Name(1): /SAS_data/MSB/Stats_Profiles_Production/Data/CntlTB/System NOTE: Libref LKUPTB was successfully assigned as follows: Physical Name(1): /SAS_data/MSB/Stats_Profiles_Production/Data/LkupTB NOTE: Libref LKUP_LIB was successfully assigned as follows: Physical Name(1): /SAS_data/MSB/Stats_Profiles_Production/Data/LkupTB NOTE: Libref LKUP_LIB was successfully assigned as follows: Physical Name(1): /SAS_data/MSB/Stats_Profiles_Production/Data/LkupTB NOTE: Libref LKUP_LIB has been deassigned. NOTE: Table LKUPTB.T_FSC created, with 3514 rows and 4 columns. NOTE: Table LKUPTB.T_FSC created, with 3514 rows and 5 columns. NOTE: Table LKUPTB.T_FSC created, with 3514 rows and 6 columns. NOTE: Libref LKUPTB was successfully assigned as follows: Physical Name(1): /SAS_data/MSB/Stats_Profiles_Production/Data/LkupTB NOTE: Libref INFO was successfully assigned as follows: Physical Name(1): /SAS_data/MSB/msp/info NOTE: Table LKUPTB.T_LOC created, with 0 rows and 8 columns. NOTE: Table LKUPTB.T_LOC_DOC created, with 0 rows and 2 columns.

3. Notes.txt NOTE: Libref LIB_IN was successfully assigned as follows: Physical Name(1): /SAS_data/MSB/Stats_Profiles_Production/Data/download NOTE: Table LKUPTB.T_PHR_DETAIL created, with 8742 rows and 36 columns. NOTE: Table LKUPTB.T_PHYS_DETAIL created, with 8742 rows and 36 columns. NOTE: Table LKUPTB.T_PHR_DOCTORS created, with 3841 rows and 35 columns. NOTE: Table LKUPTB.T_PHYS_DOCTORS created, with 3841 rows and 35 columns. NOTE: Table LKUPTB.T_DDLOOKUP created, with 8742 rows and 9 columns. NOTE: Table LKUPTB.T_DDLOOKUP created, with 8742 rows and 12 columns. NOTE: Libref STSTB was successfully assigned as follows: Physical Name(1): /SAS_data/MSB/Stats_Profiles_Production/Data/CntlTB/System NOTE: Table LKUPTB.T_RUNLKUP created, with 20 rows and 10 columns. NOTE: There were 20 observations read from the data set LKUPTB.T_RUNLKUP. NOTE: The data set LKUPTB.T_RUNLKUP has 20 observations and 11 variables. NOTE: Table WORK.REPORTCNTLREC1 created, with 20 rows and 14 columns. NOTE: Table WORK.REPORTCNTLREC2 created, with 5 rows and 14 columns. NOTE: There were 20 observations read from the data set WORK.REPORTCNTLREC1. NOTE: There were 5 observations read from the data set WORK.REPORTCNTLREC2. NOTE: The data set LKUPTB.REPORTCNTLREC has 25 observations and 14 variables. NOTE: There were 25 observations read from the data set LKUPTB.REPORTCNTLREC. NOTE: The data set LKUPTB.REPORTCNTLREC has 25 observations and 14 variables.

2. ErrLog.txt file Few lines (RUN_LoadTB_Refresh_07AUG2013_ErrLog.txt) LAST ERROR CHECK REPORT TIME: 8:33 DATE: 08/08/13 BELOW IS A BREAKDOWN OF THE KEYWORDS FOUND: KEYWORD #OF OCCURENCES --------- ----------------- INVALIDDATA 1 WARNING 4 THE SPECIFIC MESSAGES ARE AS FOLLOWS IF YOU ARE UNABLE TO RESOLVE THESE MESSAGES, PLEASE CONTACT EDA HELPLINE(866-4-EDA-HLP). ORDER# KEYWORD DETAILED KEYWORD MESSAGE ------- -------- --------------------------- 001 INVALIDDATA NOTE: Invalid data for BYEAR in line 1 38-44. 002 WARNING WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity problem. 003 WARNING WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity problem. 004 WARNING WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity problem. 005 WARNING WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this is a possible data integrity problem.

How to_create_logfile SAS Program How2_Create_Logfile.sas : /*============================================================== This code used to create the SAS Log to specified folder & file with system date which can be used to check manually or through MC_LogCheck Scan SAS program for any errors/warning and extract "Notes" information to a file This code should be used with "MC_PrintTo" SAS program. MACROs MC_PRINTTO.sas & MC_LogCheck.sas should be put into common source folder so that it can be called in through %inculde Statements in any Run time job. This program modify from to different SAS codes, so the macro run file and JobName should be same ===========================================================*/

How2_Create_Logfile.sas %INCLUDE "/folder path where source code resides/mc_printto.sas"; %let logpth = /SAS_data/.../; /* where folder path file to be saved */ %let run_file=run_mypgm1; /* Jobname of the program */ %SETLOGTO (&logpth.&run_file.); /* Your Source code goes here */ sas code ------ ------ /* sas code ends here */ /* last line to reset to normal execution for next job */ %resetprintto; /* PRINT Report to File */ %setprintto (/SAS_data/ /My_Report); Report program SAS code %resetprintto;

Retrieve the Job log created above and Scan for Error & Warning messages plus Note. Check_Joblog.sas /*----------------------------------------------------------------------------------------- This program checks the all log file of It checks for errors & Warnings as well as creates.txt file for all Notes Parameters Required are from the Create log file job 1. RUN_FILE =RUN_MyPgm1 ; * Specific file name for the run 2. JOBNAME=&RUN_FILE.; * Assign the jobname 3. JOBLOG = /where folder path for log file saved/ ; * log path 4. SYSDATE9 a system date when original job was run e.g. 07AUG2013 5. Userid User's email id * this feature has not been used yet 6. Macro LOGCHECK where the source code is in %INCLUDE "folder path where source code resides /MC_LogCheck.sas"; ---------------------------------------------------------------------------------------------*/

Retrieve the Job log created above and Scan for Error & Warning messages plus Note Check_Joblog.sas Options obs=max nosymbolgen nomlogic nomprint; %INCLUDE "/folder path where source code resides/mc_logcheck.sas"; /* logpath & JOBLOG SAME PATH */ %let JOBLOG = /SAS_data/.../; /* where folder path for log file saved */ /* SYSTEM DATE RUN */ %let jobdate=07aug2013; /* &sysdate9.*/ %LET JOBNAME=RUN_MyPgm1; %LOGCHECK (&joblog.&jobname._&jobdate..log,username); run;

Sample Test Job Program: Options obs=max nosymbolgen nomlogic nomprint; %INCLUDE "/SAS_data/MSB/Stats_Profiles_Production/Source/Macro/Comm on/mcfreports/mc_logcheck.sas"; %Let JOBLOG = /SAS_data/MSB/Stats_Profiles_Production/Doc/Log/SP_Main/; %let jobdate=07aug2013; /* &sysdate9. */ %LET JOBNAME=RUN_LoadTB_Refresh; %LOGCHECK (&joblog.&jobname._&jobdate..log,dpatel); run;

Sample Test Job A./* Create log file to specified folder */ %let RUN_FILE = MC60; %INCLUDE "/SAS_data/MSB/./Source/Macro/Common/MCFReports/MC_PRINTTO.sas"; %let logpth = /SAS_data/MSB/Stats_Profiles_Production/Doc/Log/MC60RPT/; %SETLOGTO (&logpth.&run_file.); SAS program %resetprintto; B./* create report file to specified folder */ /* Also create log file for the report */ %let RUN_log = MC60_07C; %SETLOGTO (&logpth.&run_log.); %setprintto (/SAS_data/MSB/.../Data/MW/&QTRT._&cfiscal./07C); %RPTDSPRPT (MC6026, 1, 1, &QTRN., 0); %resetprintto; %let RUN_log = MC60_09A_ALL; %SETLOGTO (&logpth.&run_log.); %setprintto (/SAS_data/MSB/.../Data/MW/&QTRT._&cfiscal./09A_ALL); %RPTDSPRPT (MC6032, 1, 1, &QTRN., 0); %resetprintto;