Program Validation: Logging the Log
|
|
- Camilla Payne
- 5 years ago
- Views:
Transcription
1 Program Validation: Logging the Log Adel Fahmy, Symbiance Inc., Princeton, NJ ABSTRACT Program Validation includes checking both program Log and Logic. The program Log should be clear of any system Error/Warning messages, which this paper will address. The program Logic is revised either manually or by writing an independent rough code that produces identical results. During the development phase, some programmers use SAS system options MPRINT, MTRACE, MLOGIC, MACROGEN, or SYMBOLGEN that result in lengthy log files. Although moving the final program into production should include switching off all of those options, this is not the case all the time. Trying to visually scan thousands of pages of a log file is tedious work that involves searching individual strings (Error, Warning, etc) one at a time. All the possible messages haven t necessarily been addressed. The generic macros presented here automate the whole process, by scanning all the logs, searching for the most common errors and producing a separate report for each processed log. A log of thousands of pages is trimmed to merely a few lines that contain error messages. The user is given full control of the messages to be searched, adding or excluding. KEYWORDS Log, Error, Warning, Validation, Audit, Quality Control, QC. AUDIENCE Programmers, Validators, Auditors & Quality Control (QC) Professionals with limited or advanced SAS experience. THE LOG FILE Turning on one or more of the SAS system options MPRINT, MTRACE, MLOGIC, MACROGEN, or SYMBOLGEN will help the programmer during the development stage of a program. They show how macro variables have been resolved and how the macros have been executing. The option FEEDBACK in PROC SQL shows how the procedure was executing. OPTIONS MPRINT MTRACE MLOGIC MACROGEN SYMBOLGEN ; PROC SQL FEEDBACK ; Those options may result in lengthy log files which are difficult to eye scan for error and warning messages. A good practice is to turn off those options before moving the final program into production. A non-sas user should be able to look at a short and clean log. Whatever the resulting log, the macro will process it and filter the error messages. OPTIONS NOMPRINT NOMTRACE NOMLOGIC NOMACROGEN NOSYMBOLGEN ; PROC SQL ; SAVING THE LOG IN AN EXTERNAL FILE During development, it is more convenient to display the log in the Program Log window. Use PRINTTO procedure to automate saving the log in a file. %LET progname = T_1_1 ; %LET dir = %STR ( c:\sponsor\protocol\study ) ; %LET savelog = %STR ( &dir\output\tables\logs\&progname..log ) ; PROC PRINTTO NEW LOG="&savelog" ; It is more convenient to save all related logs of Tables, Listings, and Derived Datasets, each in a separate LOGS directory. For example: &dir\output\tables\logs &dir\output\listings\logs &dir\output\derived\logs 1
2 SAVING THE LOG S VALIDATION Create sub-directories LOGSVLD to save the log validation reports in. For example: &dir\output\tables\logs\logsvld &dir\output\listings\logs\logsvld &dir\output\derived\logs\logsvld AVOIDING UNECESSARY LOG MESSAGES Some messages may not cause any harm to the results but could be avoided by good coding practice. For example: NOTE: Missing values were generated as a result of performing an operation on missing values. Consider the statement ( y = 2 * x ; ). This will result in the previous log message when x value is blank. This could be avoided by modifying the statement to the following simple code to handle the situation when the encountered value of the field is blank. IF x =. THEN y =. ; ELSE y = 2 * x ; NOTE: Input data set is already sorted, no sorting done. Avoiding repeated sort of the same dataset in the same order could eliminate this. In addition, this will improve efficiency WARNING: Format GENDER is already on the library. This can be eliminated by excluding multiple declaration of the same VALUE statement inproc FORMAT or multiple inclusions of the same format library. NOTE: No observations in data set WORK.RAW1. This could be avoided by using the %SYSFUNC and the numeric attribute function ATTRN to capture the Number of Observations, then conditionally execute the succeeding steps based on whether the dataset is empty or not. NOTE: Character values have been converted to numeric values. NOTE: Numeric values have been converted to character values. If n is numeric and c is character, instead of n = c use: LENGTH n 3 ; n = INPUT( c, 3. ) ; ERROR: Unable to clear or re-assign the library MAC because it is still in use. This message appears while using compiled macros in a session and trying to free all libraries (which means the macro library as well). The compiled macro library can not be cleared unless the SAS session is terminated. LIBNAME _ALL_ CLEAR ; EXCLUSIONS The following program statements may appear in the final report because of the key words they are using, but it is understood that they are valid programming statements. The macro does not exclude them, so as to prevent other error statements from slipping by. Examples: MISSING m i u ; [ in a data step ] IF x =. THEN DELETE ; [ in a data step ] dashes = REPEAT ( "-", 20 ) ; [ in a data step ] Comment: Accuracy to avoid data entry ERROR [ A Comment that started at an earlier line using "*" or "%*" or "/*" and terminated at a later line using ";" or "*/" ] READING THE LOG FILE SAS Log file has a different record length for each line. Reading variable record length techniques should be used to avoid missing any of the information that needs to be captured. Reading the variable record length will avoid the following message in our own log: NOTE: SAS went to a new line when INPUT statement reached past the end of a line. 2
3 PURPOSE OF PROGRAM To scan all log files, located at the same directory, for Error/Warning/Note messages that may include issues with the syntax/logic that need to be addressed in the program. A separate report should be produced for each processed log file. DESCRIPTION The process is automated through a set of macros and a message reference file. With all the %MACRO statements, the following options are made to store the compiled macro and give it a description. / STORE DES = my description ; For efficiency, all macros constantly use: - DROP statement to drop unnecessary variables, - PROC DATASETS to delete no longer needed datasets, - LIBNAME and FILENAME statements to clear no longer needed library and file refs. (0) _MSGREF.TXT File The Message Reference file shown in Appendix 1 contains about 80 of the most common words and text strings that appear in log messages. The user may keep adding any possible Error Message Key Words to it. The Active field serves two purposes: 1. You can activate a message by setting it to 1, or de-activate it by setting it to A Delimiter to ensure that all messages have the same Fixed Record Length, to avoid reading variable length format. Msg Active ALREADY 1 AMBIGUOUS 1 APPARENT 1.. (1) THE CALLING PROGRAM Define the compiled macro library, only ONCE in a session. Under Microsoft Windows platform, macro library cannot be deleted or redefined. %LET dsk = c ; %LET dir = %STR (&dsk:\_research\logzlog) ; %LET mac = %STR (&dir\macros) ; LIBNAME mac v8 "&mac" ; OPTIONS MSTORED SASMSTORE = mac ; Define the following directory locations: - Where the log files are located, - Where to save the validation output LOG_progname.lst, - Where to save a list LogList.txt that will contain the names of all captured log files, - Where the Message Reference _MsgRef.txt is located. %LET DirLog = %STR ( &dir\output\tables\logs ) ; %LET DirVld = %STR ( &DirLog\logsvld ) ; FILENAME _LogList "&DirVld\_LogList.txt" ; FILENAME _MsgRef "&dir\data\_msgref.txt" ; Execute compiled macros and save the Output. %process ; (2) COUNTIT Macro Count the Number of Observations in a dataset. It is used to count the number of Key Words in the _MsgRef file and the number of Log files to be processed. This macro is very efficient, particularly in large datasets, since it does not read in every record of the file. 3
4 %MACRO countit ( dsname = ) ; %GLOBAL nobs ; %LOCAL dsid ; %LET dsid = %SYSFUNC ( OPEN ( &dsname, I ) ) ; %LET nobs = %SYSFUNC ( ATTRN (&dsid, nobs) ); %LET dsid = %SYSFUNC ( CLOSE ( &dsid ) ) ; %MEND countit ; (3) MSGREF Macro Build a Message Reference Array. Read the external Error Message Reference file. Find how many key words are there. The purpose of creating the array of keywords is to make All of them available at once in front of any line of the log file that we are going to read later. In such case, we can compare the elements of the array, one at a time, until we find a match. %MACRO msgref ( msgref = ) ; DATA &msgref ; INFILE &msgref ; msg active 1. ; IF active = 1 ; %countit ( dsname = &msgref ) ; %GLOBAL nmsg ; %LET nmsg = %EVAL ( &nobs ) ; %* ; DATA msgarray ; SET &msgref END = eof ; RETAIN m1-m&nmsg ; ARRAY m (*) $25 m1-m&nmsg ; DO i=1 TO &nmsg ; IF i = _n_ THEN m(i) = msg ; END ; IF eof ; DROP i msg ; %MEND msgref ; (4) MSGGET Macro Get Only the True Error Messages. The output file name will have the same name of the program log preceded by LOG_. Because of the different Line Length in log files, they have to be read as Variable Record Length format. This technique reads the line in two steps. Initially, we read only the first character of the line, in order to capture the line length. Then we read exactly the remainder, which has the line length minus one character. Finally, we concatenate the two pieces together to create the full input line. Reading the log file as fixed length will result in SAS skipping to the next line and the loss of input data. For easy readability, SAS log contains many completely blank lines that do not contain even one space. As a result, when reading the.log file in ZLOG SAS Dataset, you will get the following NOTE statement. Those blank lines have to be excluded from processing. NOTE: SAS went to a new line when INPUT statement reached past the end of a line. SAS log does not give a sequence number for each line. If you run a second program in the same session, line numbers will continue from where the first program has left off. So, we will give each line an exact sequence number in its own file. 4
5 %MACRO msgget ( prg ) ; FILENAME zlog "&dirlog\&prg..log" ; %LET out = %str ( &dirvld\log_&prg..lst ) ; DM OUTPUT 'FILE "&out" REPLACE' ; DATA zlog ; RETAIN linum 0 ; INFILE zlog LENGTH = linelen ; char1 ; varlen = linelen - 1 ; zrest $VARYING200. varlen ; line = char1 zrest ; LABEL line = 'Captured Lines in the Log' ; LENGTH linum 5 ; linum + 1 ; %* Line Number Sequence ; DROP char1 zrest varlen ; %* ; Exclude Blank lines from input Log file. Merge the Message Array with the Log file. DATA zlog ; SET ; IF COMPRESS (line) = ' ' THEN DELETE ; PROC SQL ; CREATE TABLE zlog AS SELECT * FROM zlog, msgarray QUIT ; Compare Array elements one by one to the Line until you find the first match. Once you find the first match, stop comparing and capture that line. Exclude Titles, Footnotes, Display Manager Command and Comment lines from comparison. Count the number of captured lines with errors. If the count is zero, print a message that the log is clean; otherwise, print all captured lines. DATA zerr ; SET zlog ; ARRAY m ( * ) $ 25 m1-m&nmsg ; DO i = 1 to &nmsg ; IF INDEX ( UPCASE (line), TRIM ( m {i} ) ) > 0 AND INDEX ( UPCASE (line), "TITLE" ) = 0 AND INDEX ( UPCASE (line), FOOTNOTE" ) = 0 AND INDEX ( UPCASE (line), "DM" ) = 0 AND INDEX ( UPCASE (line), "*" ) = 0 AND INDEX ( UPCASE (line), "'" ) = 0 AND INDEX ( UPCASE (line), '"' ) = 0 THEN DO ; OUTPUT ; RETURN ; END ; END ; DROP i m1-m&nmsg ; 5
6 %countit ( dsname = zerr ) ; %IF &nobs = 0 %THEN %DO ; DATA zerr ; Line = '### The Log is Clean of Any Errors ###'; LABEL line = ' ' ; OUTPUT ; %END ; PROC PRINTTO NEW PRINT = "&out" ; OPTIONS PAGENO = 1 ; PROC PRINT N NOOBS LABEL DATA = zerr ; FORMAT line $126. ; TITLE "Log Error Messages: %UPCASE (&dirlog\&prg..log) * &SYSDATE *" ; PROC PRINTTO; RUN; %MEND msgget ; (5) GETLOGS Macro By using the X command, you can capture all the names of the log files. The user has to provide only the directory where the logs have been saved, rather than each individual log file to be processed. Use X_Command to execute DOS Commands (for SAS under Microsoft Windows platform). This will capture a list of all log files in a Directory. Save the list in a Text file _LOGLIST.TXT. %MACRO getlogs ( dirname =, listname = ) ; OPTIONS NOXWAIT NOXSYNC ; X "dir/-p/b/o:n &dirname\*.log > &dirvld\&listname..txt" ; X "exit" ; %MEND getlogs ; (6) LOGARRAY Macro Count how many log files will be processed. Create an array of macro variables that contain the file names when resolved. The file will be read as a variable length format, since the name in MS Windows can vary from short to long names. Exclude the.log file extension (4 characters) from the names. %MACRO logarray ( listname = ) ; DATA &listname ; RETAIN linum 0; INFILE &listname LENGTH = linelen END = eof ; char1 ; varlen = linelen - 1 ; zrest $VARYING100. varlen ; line = char1 zrest ; LABEL line = 'Log File Name' ; 6
7 LENGTH LINUM 3 ; linum + 1 ; %* Line Number Sequence; %GLOBAL nmember ; line = SUBSTR ( line, 1, LENGTH ( line ) - 4 ) ; IF eof THEN CALL SYMPUT ( 'nmember', PUT ( linum, 3. ) ) ; DROP char1 zrest varlen ; %* ; %DO i =1 %TO &nmember ; %GLOBAL memno&i ; %END ; DATA _NULL_; SET &listname ; CALL SYMPUT ( 'memno' LEFT ( PUT ( linum, 3. ) ), TRIM ( line )); %MEND logarray ; (7) PROCESS Macro Process All Log File Names that have been captured in the Array of Macro Variables. %MACRO process ; %msgref ( msgref = _MsgRef ) ; %getlogs ( dirname = &DirLog, listname =_LogList ) ; %logarray ( listname = _LogList ) ; %DO i = 1 %TO &nmember ; %msgget ( &&memno&i ) ; %END ; %MEND process ; CONCLUSION These macros will build a message reference file, compare it to each line of a log file and produce a report that includes only those messages that need to be addressed in the program code. The macros are generic and will apply to any log. The user has the option of modifying the message reference file by adding or excluding any messages as necessary. VALIDATION The macro and sample calls have been fully tested and validated using SAS Version 8.02 and 6.12 software on Microsoft Windows platform. REFERENCES SAS Macro Language, Reference, V8, Oct SAS Procedures Guide, Reference, V8, Jun SAS Language Reference, Concepts, V8, Nov SAS Base, Language Reference, V6, E1, Feb
8 AUTHOR Adel Fahmy is an Independent Consultant. Previously, he worked as Sr. Statistical Programmer and Associate Director of Systems at major pharmaceutical companies and clinical research organizations, and as internal consultant at universities, teaching SAS to faculty and students. Adel has been a SAS user for 20 years. His special achievements include Generic Macros, Edit Checks, Database Design, Menu-Driven Systems, Optimization Techniques and Project Management. Adel has BS in Mathematics, Graduate Diploma in Systems Design, MS and M.Phil. in Computer Science from Nottingham University, UK. CONTACT Your comments and questions are welcomed. The author can be contacted at: Adel Fahmy, EMS: Adel.Fahmy@att.net Voice: (732) COPYRIGHTS 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. Windows is a registered trademark of Microsoft Inc. Other brand and product names are registered trademarks or trademarks of their respective companies. Appendix 1 Message Reference File: _MSGREF.TXT ALREADY 1 AMBIGUOUS 1 APPARENT 1 ASSUMING 1 BECAUSE 1 CAN NOT 1 CANNOT 1 CAUSE 1 CONVERTED 1 DIFFERENT 1 DO NOT 1 DOES NOT 1 DUMMY 1 END OF 1 ENDS IN 1 ERROR 1 EXCEED 1 EXPECTING 1 FOUND 1 HAS NOT 1 HELD BY 1 IGNORED 1 IN USE 1 INCOMPLETE 1 INCORRECT 1 INVALID 1 MISSING 1 MISSPELLED 1 MORE THAN 1 MUST BE 1 MULTI 1 NEVER BEEN 1 NEW LINE 1 NO BY 1 NO LONGER 1 NO MATCHING 1 NO OBSERVATIONS 1 NO OUTPUT 1 NO SORTING 1 NO STATISTICS 1 8 NOT ABLE 1 NOT ALLOWED 1 NOT ASSIGNED 1 NOT AVAILABLE 1 NOT BE 1 NOT CREATED 1 NOT EXIST 1 NOT FOUND 1 NOT RECOGNIZED 1 NOT REPLACED 1 NOT RESOLVED 1 NOT SORTED 1 NOT VALID 1 OMITTED 1 ONLY 1 ORDER 1 PARTIALLY 1 PAST 1 PROPER 1 QUOTING 1 REACHED 1 REPEAT BY 1 SHARING 1 SHOULD BE 1 STILL 1 STOPPED 1 TO CONTINUE 1 TO END 1 TOO LONG 1 TRUNCATED 1 UNABLE 1 UNBALANCED 1 UNDECLARED 1 UNINITIALIZED 1 UNKNOWN 1 UNQUOTED 1 VIOLATION 1 WARNING 1 WHEN 1 WILL BE 1
Logging the Log Magic: Pulling the Rabbit out of the Hat
ABSTRACT PharmaSUG2010 - Paper TT08 Logging the Log Magic: Pulling the Rabbit out of the Hat Adel Fahmy, BenchWorkzz, Austin, Texas Program Validation includes checking both program Log and Logic. Program
More informationExporting & Importing Datasets & Catalogs: Utility Macros
Exporting & Importing Datasets & Catalogs: Utility Macros Adel Fahmy, SYSMART Consulting, North Brunswick, NJ ABSTRACT Since different companies use different SAS versions installed on different platforms,
More informationA Time Saver for All: A SAS Toolbox Philip Jou, Baylor University, Waco, TX
South Central SAS Users Group 2016 A Time Saver for All: A SAS Toolbox Philip Jou, Baylor University, Waco, TX ABSTRACT SAS Macros are a useful tool to any SAS Programmer. A macro variable can be used
More informationBase and Advance SAS
Base and Advance SAS BASE SAS INTRODUCTION An Overview of the SAS System SAS Tasks Output produced by the SAS System SAS Tools (SAS Program - Data step and Proc step) A sample SAS program Exploring SAS
More informationtitle1 "Visits at &string1"; proc print data=hospitalvisits; where sitecode="&string1";
PharmaSUG 2012 Paper TF01 Macro Quoting to the Rescue: Passing Special Characters Mary F. O. Rosenbloom, Edwards Lifesciences LLC, Irvine, CA Art Carpenter, California Occidental Consultants, Anchorage,
More informationRun your reports through that last loop to standardize the presentation attributes
PharmaSUG2011 - Paper TT14 Run your reports through that last loop to standardize the presentation attributes Niraj J. Pandya, Element Technologies Inc., NJ ABSTRACT Post Processing of the report could
More informationAN INTRODUCTION TO MACRO VARIABLES AND MACRO PROGRAMS Mike Zdeb, School of Public Health
AN INTRODUCTION TO MACRO VARIABLES AND MACRO PROGRAMS Mike Zdeb, University@Albany School of Public Health INTRODUCTION There are a number of SAS tools that you may never have to use. Why? The main reason
More informationCC13 An Automatic Process to Compare Files. Simon Lin, Merck & Co., Inc., Rahway, NJ Huei-Ling Chen, Merck & Co., Inc., Rahway, NJ
CC13 An Automatic Process to Compare Files Simon Lin, Merck & Co., Inc., Rahway, NJ Huei-Ling Chen, Merck & Co., Inc., Rahway, NJ ABSTRACT Comparing different versions of output files is often performed
More informationPaper CC16. William E Benjamin Jr, Owl Computer Consultancy LLC, Phoenix, AZ
Paper CC16 Smoke and Mirrors!!! Come See How the _INFILE_ Automatic Variable and SHAREBUFFERS Infile Option Can Speed Up Your Flat File Text-Processing Throughput Speed William E Benjamin Jr, Owl Computer
More informationA Macro that can Search and Replace String in your SAS Programs
ABSTRACT MWSUG 2016 - Paper BB27 A Macro that can Search and Replace String in your SAS Programs Ting Sa, Cincinnati Children s Hospital Medical Center, Cincinnati, OH In this paper, a SAS macro is introduced
More informationSo Much Data, So Little Time: Splitting Datasets For More Efficient Run Times and Meeting FDA Submission Guidelines
Paper TT13 So Much Data, So Little Time: Splitting Datasets For More Efficient Run Times and Meeting FDA Submission Guidelines Anthony Harris, PPD, Wilmington, NC Robby Diseker, PPD, Wilmington, NC ABSTRACT
More informationDSCI 325: Handout 15 Introduction to SAS Macro Programming Spring 2017
DSCI 325: Handout 15 Introduction to SAS Macro Programming Spring 2017 The Basics of the SAS Macro Facility Macros are used to make SAS code more flexible and efficient. Essentially, the macro facility
More informationA Macro To Generate a Study Report Hany Aboutaleb, Biogen Idec, Cambridge, MA
Paper PO26 A Macro To Generate a Study Report Hany Aboutaleb, Biogen Idec, Cambridge, MA Abstract: Imagine that you are working on a study (project) and you would like to generate a report for the status
More informationFoundations and Fundamentals. SAS System Options: The True Heroes of Macro Debugging Kevin Russell and Russ Tyndall, SAS Institute Inc.
SAS System Options: The True Heroes of Macro Debugging Kevin Russell and Russ Tyndall, SAS Institute Inc., Cary, NC ABSTRACT It is not uncommon for the first draft of any macro application to contain errors.
More informationSAS CURRICULUM. BASE SAS Introduction
SAS CURRICULUM BASE SAS Introduction Data Warehousing Concepts What is a Data Warehouse? What is a Data Mart? What is the difference between Relational Databases and the Data in Data Warehouse (OLTP versus
More informationA Mass Symphony: Directing the Program Logs, Lists, and Outputs
PharmaSUG2011 Paper CC24 ABSTRACT A Mass Symphony: Directing the Program Logs, Lists, and Outputs Tom Santopoli, Octagon Research Solutions, Inc., Wayne, PA When executing programs in SAS, it is efficient
More informationUsing SAS to Control the Post Processing of Microsoft Documents Nat Wooding, J. Sargeant Reynolds Community College, Richmond, VA
Using SAS to Control the Post Processing of Microsoft Documents Nat Wooding, J. Sargeant Reynolds Community College, Richmond, VA Chen, SUGI 31, showed how to use SAS and VBA to automate the post processing
More informationWhy & How To Use SAS Macro Language: Easy Ways To Get More Value & Power from Your SAS Software Tools
Why & How To Use SAS Macro Language: Easy Ways To Get More Value & Power from Your SAS Software Tools LeRoy Bessler PhD Bessler Consulting and Research Strong Smart Systems Mequon, WI, USA Le_Roy_Bessler@wi.rr.com
More informationGoing Under the Hood: How Does the Macro Processor Really Work?
Going Under the Hood: How Does the Really Work? ABSTRACT Lisa Lyons, PPD, Inc Hamilton, NJ Did you ever wonder what really goes on behind the scenes of the macro processor, or how it works with other parts
More informationA Tutorial on the SAS Macro Language
HW152 SESUG 2015 A Tutorial on the SAS Macro Language John J. Cohen, Advanced Data Concepts LLC, Newark, DE ABSTRACT The SAS Macro language is another language that rests on top of regular SAS code. If
More informationCONQUERING THE DREADED MACRO ERROR
CONQUERING THE DREADED MACRO ERROR by Katie A. Hubbell Computer Data Systems, Inc. ABSTRACT The Macro facility is a very powerful tool in SAS* programming. It can, by the same token, cause some rather
More informationDebugging. Where to start? John Ladds, SAS Technology Center, Statistics Canada.
Debugging Where to start? John Ladds, SAS Technology Center, Statistics Canada Come out of the desert of ignorance to the OASUS of knowledge Did it work? I don t see any red. So it must have worked, right?
More informationSAS Macro. SAS Training Courses. Amadeus Software Ltd
SAS Macro SAS Training Courses By Amadeus Software Ltd AMADEUS SOFTWARE LIMITED SAS TRAINING Amadeus have been delivering SAS Training since 1989 and our aim is to provide you with best quality SAS training
More informationIntroduction. Getting Started with the Macro Facility CHAPTER 1
1 CHAPTER 1 Introduction Getting Started with the Macro Facility 1 Replacing Text Strings Using Macro Variables 2 Generating SAS Code Using Macros 3 Inserting Comments in Macros 4 Macro Definition Containing
More informationUsing GSUBMIT command to customize the interface in SAS Xin Wang, Fountain Medical Technology Co., ltd, Nanjing, China
PharmaSUG China 2015 - Paper PO71 Using GSUBMIT command to customize the interface in SAS Xin Wang, Fountain Medical Technology Co., ltd, Nanjing, China One of the reasons that SAS is widely used as the
More informationInternet, Intranets, and The Web
Paper 175-25 Security on the Web using SAS/IntrNet Software and HTML Ming C. Lee, Trilogy Consulting, Denver, CO Abstract The increase in INTERNET usage from both companies and from the general public
More informationValidation Summary using SYSINFO
Validation Summary using SYSINFO Srinivas Vanam Mahipal Vanam Shravani Vanam Percept Pharma Services, Bridgewater, NJ ABSTRACT This paper presents a macro that produces a Validation Summary using SYSINFO
More informationAcknowledgments xi Preface xiii About the Author xv About This Book xvii New in the Macro Language xxi
Contents Part 1 Acknowledgments xi Preface xiii About the Author xv About This Book xvii New in the Macro Language xxi Macro Basics Chapter 1 Introduction 3 1.1 Macro Facility Overview 3 1.2 Terminology
More informationINTRODUCTION TO SAS HOW SAS WORKS READING RAW DATA INTO SAS
TO SAS NEED FOR SAS WHO USES SAS WHAT IS SAS? OVERVIEW OF BASE SAS SOFTWARE DATA MANAGEMENT FACILITY STRUCTURE OF SAS DATASET SAS PROGRAM PROGRAMMING LANGUAGE ELEMENTS OF THE SAS LANGUAGE RULES FOR SAS
More informationMore About SAS Macros
More About SAS Macros (Than You Thought Possible) Donald P. Gallogly DCBS IMD Topics The SAS Macros System Macro Variables Writing Macros The SAS Macros System The SAS Macros System SAS macros and macro
More informationSURVIVING THE SAS MACRO JUNGLE BY USING YOUR OWN PROGRAMMING TOOLKIT
PharmaSUG 2016 Paper BB11 SURVIVING THE SAS MACRO JUNGLE BY USING YOUR OWN PROGRAMMING TOOLKIT KEVIN RUSSELL Photo credit: Geoff Gallice / CC by 2.0 TOOLS FOR YOUR MACRO PROGRAMMING TOOLKIT The DOSUBL
More informationBasic Macro Processing Prepared by Destiny Corporation
Basic Macro Processing Prepared by Destiny Corporation Macro variables In this module we discuss the first of the two special characters - the ampersand (&). When the SAS Supervisor sees an ampersand followed
More informationMOBILE MACROS GET UP TO SPEED SOMEWHERE NEW FAST Author: Patricia Hettinger, Data Analyst Consultant Oakbrook Terrace, IL
MOBILE MACROS GET UP TO SPEED SOMEWHERE NEW FAST Author: Patricia Hettinger, Data Analyst Consultant Oakbrook Terrace, IL ABSTRACT: Have you ever been faced with this scenario? It s your first day on the
More informationABSTRACT INTRODUCTION THE GENERAL FORM AND SIMPLE CODE
Paper SA06 Painless Extraction: Options and Macros with PROC PRESENV Keith Fredlund, MS (candidate) Grand Valley State University, Allendale, Michigan; Thinzar Wai, MS (candidate) Grand Valley State University,
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 informationPharmaSUG Paper TT11
PharmaSUG 2014 - Paper TT11 What is the Definition of Global On-Demand Reporting within the Pharmaceutical Industry? Eric Kammer, Novartis Pharmaceuticals Corporation, East Hanover, NJ ABSTRACT It is not
More informationABSTRACT INTRODUCTION TRICK 1: CHOOSE THE BEST METHOD TO CREATE MACRO VARIABLES
An Efficient Method to Create a Large and Comprehensive Codebook Wen Song, ICF International, Calverton, MD Kamya Khanna, ICF International, Calverton, MD Baibai Chen, ICF International, Calverton, MD
More informationSAS Macro Language: Reference
SAS Macro Language: Reference INTRODUCTION Getting Started with the Macro Facility This is the macro facility language reference for the SAS System. It is a reference for the SAS macro language processor
More informationEfficiency Programming with Macro Variable Arrays
ABSTRACT MWSUG 2018 - Paper SP-062 Efficiency Programming with Macro Variable Arrays Veronica Renauldo, QST Consultations, LTD, Allendale, MI Macros in themselves boost productivity and cut down on user
More informationUsing a Control Dataset to Manage Production Compiled Macro Library Curtis E. Reid, Bureau of Labor Statistics, Washington, DC
AP06 Using a Control Dataset to Manage Production Compiled Macro Library Curtis E. Reid, Bureau of Labor Statistics, Washington, DC ABSTRACT By default, SAS compiles and stores all macros into the WORK
More informationGet Started Writing SAS Macros Luisa Hartman, Jane Liao, Merck Sharp & Dohme Corp.
Get Started Writing SAS Macros Luisa Hartman, Jane Liao, Merck Sharp & Dohme Corp. ABSTRACT The SAS Macro Facility is a tool which lends flexibility to your SAS code and promotes easier maintenance. It
More informationProcedure for Stamping Source File Information on SAS Output Elizabeth Molloy & Breda O'Connor, ICON Clinical Research
Procedure for Stamping Source File Information on SAS Output Elizabeth Molloy & Breda O'Connor, ICON Clinical Research ABSTRACT In the course of producing a report for a clinical trial numerous drafts
More informationA SAS Macro for Producing Benchmarks for Interpreting School Effect Sizes
A SAS Macro for Producing Benchmarks for Interpreting School Effect Sizes Brian E. Lawton Curriculum Research & Development Group University of Hawaii at Manoa Honolulu, HI December 2012 Copyright 2012
More informationCopy That! Using SAS to Create Directories and Duplicate Files
Copy That! Using SAS to Create Directories and Duplicate Files, SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and
More informationLST in Comparison Sanket Kale, Parexel International Inc., Durham, NC Sajin Johnny, Parexel International Inc., Durham, NC
ABSTRACT PharmaSUG 2013 - Paper PO01 LST in Comparison Sanket Kale, Parexel International Inc., Durham, NC Sajin Johnny, Parexel International Inc., Durham, NC The need for producing error free programming
More informationBad Date: How to find true love with Partial Dates! Namrata Pokhrel, Accenture Life Sciences, Berwyn, PA
PharmaSUG 2014 Paper PO09 Bad Date: How to find true love with Partial Dates! Namrata Pokhrel, Accenture Life Sciences, Berwyn, PA ABSTRACT This poster will discuss the difficulties encountered while trying
More informationHow to use UNIX commands in SAS code to read SAS logs
SESUG Paper 030-2017 How to use UNIX commands in SAS code to read SAS logs James Willis, OptumInsight ABSTRACT Reading multiple logs at the end of a processing stream is tedious when the process runs on
More informationA Table Driven ODS Macro Diane E. Brown, exponential Systems, Indianapolis, IN
A Table Driven ODS Macro Diane E. Brown, exponential Systems, Indianapolis, IN ABSTRACT Tired of coding ODS statements and SAS output procedures for every report you write and having redundant or similar
More informationHAVE YOU EVER WISHED THAT YOU DO NOT NEED TO TYPE OR CHANGE REPORT NUMBERS AND TITLES IN YOUR SAS PROGRAMS?
HAVE YOU EVER WISHED THAT YOU DO NOT NEED TO TYPE OR CHANGE REPORT NUMBERS AND TITLES IN YOUR SAS PROGRAMS? Aileen L. Yam, PharmaNet, Inc., Princeton, NJ ABSTRACT In clinical research, the table of contents
More informationContents. Overview How SAS processes programs Compilation phase Execution phase Debugging a DATA step Testing your programs
SAS Data Step Contents Overview How SAS processes programs Compilation phase Execution phase Debugging a DATA step Testing your programs 2 Overview Introduction This section teaches you what happens "behind
More informationYour Own SAS Macros Are as Powerful as You Are Ingenious
Paper CC166 Your Own SAS Macros Are as Powerful as You Are Ingenious Yinghua Shi, Department Of Treasury, Washington, DC ABSTRACT This article proposes, for user-written SAS macros, separate definitions
More informationAn Introduction to Macros Deb Cassidy
Paper #HW03 An Introduction to Macros Deb Cassidy Abstract A search in the proceedings for SUGI 24-28 for the word "macro" had over 1,000 hits. Why are macros so popular? A quick glance through the papers
More informationCutting the SAS LOG down to size Malachy J. Foley, University of North Carolina at Chapel Hill, NC
Paper SY05 Cutting the SAS LOG down to size Malachy J. Foley, University of North Carolina at Chapel Hill, NC ABSTRACT Looking through a large SAS LOG (say 250 pages) for NOTE's and WARNING's that might
More informationUnlock SAS Code Automation with the Power of Macros
SESUG 2015 ABSTRACT Paper AD-87 Unlock SAS Code Automation with the Power of Macros William Gui Zupko II, Federal Law Enforcement Training Centers SAS code, like any computer programming code, seems to
More informationA Useful Macro for Converting SAS Data sets into SAS Transport Files in Electronic Submissions
Paper FC07 A Useful Macro for Converting SAS Data sets into SAS Transport Files in Electronic Submissions Xingshu Zhu and Shuping Zhang Merck Research Laboratories, Merck & Co., Inc., Blue Bell, PA 19422
More informationTLF Management Tools: SAS programs to help in managing large number of TLFs. Eduard Joseph Siquioco, PPD, Manila, Philippines
PharmaSUG China 2018 Paper AD-58 TLF Management Tools: SAS programs to help in managing large number of TLFs ABSTRACT Eduard Joseph Siquioco, PPD, Manila, Philippines Managing countless Tables, Listings,
More informationStatistics, Data Analysis & Econometrics
ST009 PROC MI as the Basis for a Macro for the Study of Patterns of Missing Data Carl E. Pierchala, National Highway Traffic Safety Administration, Washington ABSTRACT The study of missing data patterns
More informationA SAS Macro to Create Validation Summary of Dataset Report
ABSTRACT PharmaSUG 2018 Paper EP-25 A SAS Macro to Create Validation Summary of Dataset Report Zemin Zeng, Sanofi, Bridgewater, NJ This paper will introduce a short SAS macro developed at work to create
More informationEfficient Processing of Long Lists of Variable Names
Efficient Processing of Long Lists of Variable Names Paulette W. Staum, Paul Waldron Consulting, West Nyack, NY ABSTRACT Many programmers use SAS macro language to manipulate lists of variable names. They
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 informationUsing UNIX Shell Scripting to Enhance Your SAS Programming Experience
Using UNIX Shell Scripting to Enhance Your SAS Programming Experience By James Curley SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute
More informationTired of CALL EXECUTE? Try DOSUBL
ABSTRACT SESUG Paper BB-132-2017 Tired of CALL EXECUTE? Try DOSUBL Jueru Fan, PPD, Morrisville, NC DOSUBL was first introduced as a function in SAS V9.3. It enables the immediate execution of SAS code
More informationTop Coding Tips. Neil Merchant Technical Specialist - SAS
Top Coding Tips Neil Merchant Technical Specialist - SAS Bio Work in the ANSWERS team at SAS o Analytics as a Service and Visual Analytics Try before you buy SAS user for 12 years obase SAS and O/S integration
More informationTaming a Spreadsheet Importation Monster
SESUG 2013 Paper BtB-10 Taming a Spreadsheet Importation Monster Nat Wooding, J. Sargeant Reynolds Community College ABSTRACT As many programmers have learned to their chagrin, it can be easy to read Excel
More informationTop-Down Programming with SAS Macros Edward Heaton, Westat, Rockville, MD
Paper P813 Top-Down Programming with SAS Macros Edward Heaton, Westat, Rockville, MD ABSTRACT Structured, top-down programming techniques are not intuitively obvious in the SAS language, but macros can
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 informationMacros from Beginning to Mend A Simple and Practical Approach to the SAS Macro Facility
Macros from Beginning to Mend A Simple and Practical Approach to the SAS Macro Facility Michael G. Sadof, MGS Associates, Inc., Bethesda, MD. ABSTRACT The macro facility is an important feature of the
More informationSimplifying Your %DO Loop with CALL EXECUTE Arthur Li, City of Hope National Medical Center, Duarte, CA
PharmaSUG 2017 BB07 Simplifying Your %DO Loop with CALL EXECUTE Arthur Li, City of Hope National Medical Center, Duarte, CA ABSTRACT One often uses an iterative %DO loop to execute a section of a macro
More informationSAS Viya 3.1 FAQ for Processing UTF-8 Data
SAS Viya 3.1 FAQ for Processing UTF-8 Data Troubleshooting Tips for Processing UTF-8 Data (Existing SAS Code) What Is the Encoding of My Data Set? PROC CONTENTS displays information about the data set
More informationMake Your Life a Little Easier: A Collection of SAS Macro Utilities. Pete Lund, Northwest Crime and Social Research, Olympia, WA
Make Your Life a Little Easier: A Collection of SAS Macro Utilities Pete Lund, Northwest Crime and Social Research, Olympia, WA ABSTRACT SAS Macros are used in a variety of ways: to automate the generation
More informationSandra Hendren Health Data Institute
INTRODUCTION TO THE MACRO LANGUAGE Sandra Hendren Health Data Institute The purpose of this paper is to explain the macro language at a conceptual level. It will not discuss the syntax of the language
More informationDemystifying Inherited Programs
Demystifying Inherited Programs Have you ever inherited a program that leaves you scratching your head trying to figure it out? If you have not, chances are that some time in the future you will. While
More informationDeveloping Data-Driven SAS Programs Using Proc Contents
Developing Data-Driven SAS Programs Using Proc Contents Robert W. Graebner, Quintiles, Inc., Kansas City, MO ABSTRACT It is often desirable to write SAS programs that adapt to different data set structures
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 Macro to Keep Titles and Footnotes in One Place
CC25 ABSTRACT A Macro to Keep Titles and Footnotes in One Place John Morrill, Quintiles, Inc., Kansas City, MO A large project with titles and footnotes in each separate program can be cumbersome to maintain.
More informationA Macro to Create Program Inventory for Analysis Data Reviewer s Guide Xianhua (Allen) Zeng, PAREXEL International, Shanghai, China
PharmaSUG 2018 - Paper QT-08 A Macro to Create Program Inventory for Analysis Data Reviewer s Guide Xianhua (Allen) Zeng, PAREXEL International, Shanghai, China ABSTRACT As per Analysis Data Reviewer s
More information3. Almost always use system options options compress =yes nocenter; /* mostly use */ options ps=9999 ls=200;
Randy s SAS hints, updated Feb 6, 2014 1. Always begin your programs with internal documentation. * ***************** * Program =test1, Randy Ellis, first version: March 8, 2013 ***************; 2. Don
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 informationMIS Reporting in the Credit Card Industry
MIS Reporting in the Credit Card Industry Tom Hotard, Acxiom Corporation ABSTRACT In credit card acquisition campaigns, it is important to have the ability to keep track of various types of counts. After
More informationPharmaSUG Paper PO12
PharmaSUG 2015 - Paper PO12 ABSTRACT Utilizing SAS for Cross-Report Verification in a Clinical Trials Setting Daniel Szydlo, Fred Hutchinson Cancer Research Center, Seattle, WA Iraj Mohebalian, Fred Hutchinson
More informationBetter Metadata Through SAS II: %SYSFUNC, PROC DATASETS, and Dictionary Tables
Paper 3458-2015 Better Metadata Through SAS II: %SYSFUNC, PROC DATASETS, and Dictionary Tables ABSTRACT Louise Hadden, Abt Associates Inc., Cambridge, MA SAS provides a wealth of resources for users to
More informationThe Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data
Paper PO31 The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data MaryAnne DePesquo Hope, Health Services Advisory Group, Phoenix, Arizona Fen Fen Li, Health Services Advisory Group,
More informationSTATION
------------------------------STATION 1------------------------------ 1. Which of the following statements displays all user-defined macro variables in the SAS log? a) %put user=; b) %put user; c) %put
More informationSymbol Table Generator (New and Improved) Jim Johnson, JKL Consulting, North Wales, PA
PharmaSUG2011 - Paper AD19 Symbol Table Generator (New and Improved) Jim Johnson, JKL Consulting, North Wales, PA ABSTRACT In Seattle at the PharmaSUG 2000 meeting the Symbol Table Generator was first
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 informationSAS Programming Techniques for Manipulating Metadata on the Database Level Chris Speck, PAREXEL International, Durham, NC
PharmaSUG2010 - Paper TT06 SAS Programming Techniques for Manipulating Metadata on the Database Level Chris Speck, PAREXEL International, Durham, NC ABSTRACT One great leap that beginning and intermediate
More informationSAS Certification Handout #11: Adv. Prog. Ch. 9-10
SAS Certification Handout #11: Adv. Prog. Ch. 9-10 /************ Ch. 9 ********************/ /* SAS Macros -- like writing your own functions in SAS; especially useful for reproducing analyses or reports
More informationMy objective is twofold: Examine the capabilities of MP Connect and apply those capabilities to a real-world application.
Abstract MP CONNECT: Warp Engine for SAS (Multi-Processing in the Sun Solaris Environment). Pablo J. Nogueras CitiFinancial International, Risk Management Technology, Irving, Texas When you are assigned
More informationAn Automation Procedure for Oracle Data Extraction and Insertion
An Automation Procedure for Oracle Data Extraction and Insertion Shiqun S. Li, Smith Hanley, East Hanover, NJ David H. Wilcox, NYS Department of Health, Albany, NY ABSTRACT SAS software provides strong
More informationODS DOCUMENT, a practical example. Ruurd Bennink, OCS Consulting B.V., s-hertogenbosch, the Netherlands
Paper CC01 ODS DOCUMENT, a practical example Ruurd Bennink, OCS Consulting B.V., s-hertogenbosch, the Netherlands ABSTRACT The ODS DOCUMENT destination (in short ODS DOCUMENT) is perhaps the most underutilized
More informationDATA Step Debugger APPENDIX 3
1193 APPENDIX 3 DATA Step Debugger Introduction 1194 Definition: What is Debugging? 1194 Definition: The DATA Step Debugger 1194 Basic Usage 1195 How a Debugger Session Works 1195 Using the Windows 1195
More informationUntangling and Reformatting NT PerfMon Data to Load a UNIX SAS Database With a Software-Intelligent Data-Adaptive Application
Paper 297 Untangling and Reformatting NT PerfMon Data to Load a UNIX SAS Database With a Software-Intelligent Data-Adaptive Application Heather McDowell, Wisconsin Electric Power Co., Milwaukee, WI LeRoy
More informationReading in Data Directly from Microsoft Word Questionnaire Forms
Paper 1401-2014 Reading in Data Directly from Microsoft Word Questionnaire Forms Sijian Zhang, VA Pittsburgh Healthcare System ABSTRACT If someone comes to you with hundreds of questionnaire forms in Microsoft
More informationSTAT:5400 Computing in Statistics. Other software packages. Microsoft Excel spreadsheet very convenient for entering data in flatfile
STAT:5400 Computing in Statistics Other Software Packages Proc import A bit on SAS macro language Lecture 26 ov 2, 2016 Kate Cowles 374 SH, 335-0727 kate-cowles@uiowaedu Other software packages Microsoft
More informationA Generalized Macro-Based Data Reporting System to Produce Both HTML and Text Files
A Generalized Macro-Based Data Reporting System to Produce Both HTML and Text Files Jeff F. Sun, Blue Cross Blue Shield of North Carolina, Durham, North Carolina Abstract This paper will address the inter-connection
More informationSeminar Series: CTSI Presents
Biostatistics, Epidemiology & Research Design (BERD) Howard Cabral, PhD, MPH Christine Chaisson, MPH Seminar Series: CTSI Presents November 20, 2014 Demystifying SAS Macros BUSPH Data Coordinating Center
More informationHow a Code-Checking Algorithm Can Prevent Errors
How a Code-Checking Algorithm Can Prevent Errors 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.
More informationFuzzy Matching with SAS: Data Analysts Tool to Cleaner Data. Josh Fogarasi
Fuzzy Matching with SAS: Data Analysts Tool to Cleaner Data Josh Fogarasi Agenda What is Fuzzy Matching Anyways? Why is it relevant to a Data Professional? Introducing some useful SAS Text Functions Fuzzy
More informationImplementing external file processing with no record delimiter via a metadata-driven approach
Paper 2643-2018 Implementing external file processing with no record delimiter via a metadata-driven approach Princewill Benga, F&P Consulting, Saint-Maur, France ABSTRACT Most of the time, we process
More informationSAS System Powers Web Measurement Solution at U S WEST
SAS System Powers Web Measurement Solution at U S WEST Bob Romero, U S WEST Communications, Technical Expert - SAS and Data Analysis Dale Hamilton, U S WEST Communications, Capacity Provisioning Process
More information