|
|
- Georgina Gaines
- 5 years ago
- Views:
Transcription
1
2
3
4
5
6 rc = libname( mylib, /nosuch ); if rc ne 0 then %fatal; OR if libname( mylib, /nosuch ) then %fatal;
7 Select (flag); when (1) when (2) otherwise %fatal(text= Unexpected flag value, syscodes=n); end;
8
9 %macro fatal(text=,syscodes=y); do;... end; %mend %fatal;
10 _sysrc = sysrc(); _sysmsg = sysmsg(); put _all_; call display( fatal.frame,_sysrc, _sysmsg,,&text, &syscodes,&errnum );
11 %macro %fatalin; %global _errnum; %let _errnum = 0; %mend %fatalin %let _errnum = %eval(&_errnum + 1);
12
13
14
15 call execcmd( build!!pgm!! ; ); if scan(pgm,4,. ) eq FRAME then call execcmd( src; ); cmd= find %fatalin ; ; call execcmd(cmd); do i=1 to errnum; call execcmd( find %fatal ; ); end;
16
17
18
19
20 Andrew Ratcliffe, Ratcliffe Technical Services Limited It seems that, no matter how much experience one gains, no matter how much planning one completes, bugs are still an inevitability in software development. So, if bugs can t be eradicated during the analysis, design, or programming stages, how can we make the investigation and resolution of them easier during the testing stage? This brief paper describes some simple, practical tools for ensuring that the debugging process is less painful and more efficient. Two are specifically for use in SAS/AF applications, the third can be used in both SAS/AF and base SAS environments. One of the ways that the task of bug fixing can be enhanced is to catch the problem as soon as it occurs. Unless every single return code is checked, a problem can continue until it causes a bigger problem at a later stage. This paper describes a quick and convenient method for testing and capturing every return code - and presenting meaningful information should a failure occur. Introduction A large proportion of SCL-coding involves calling functions. Each function returns a value that can be tested for success. In some cases, the application logic will want to perform alternative actions dependant upon the return value, but in many cases the application is left with no way it can reasonably continue if the return code indicates failure. Examples include failure to open data sets, to allocate librefs, and to manipulate lists. Where the application has no sensible option but to terminate gracefully, the maintenance programmer would like some information regarding why the error occurred so that he/she may attempt to fix the underlying problem. Often, these return codes are not checked by the program so that a) the program continues until it fails big-time, and b) the maintenance programmer's task is harder because the debugging information has been muddied by the subsequent program activity. The reason that programmers don't write return code checks is that it involves a great deal of repetitive, space-consuming code. I use a simple macro to do this. Using the macro takes away the repetition from me, and does not result in my source code being elongated by reams of checking code. Because my source code is no longer, I can still see the same amount of functional code on my screen.
21 What it does The macro is based upon the Error Handler described by John Watts[1] at SEUGI 94. The macro is used as shown below. rc = close(d_rawpeg); if rc ne 0 then %fatal; On the face of it, it adds one extra line of code for each call. However, it can be called as follows. if close(d_rawpeg) then %fatal; Using the above style results in no extra lines of source code. The macro generates SCL code (at compile-time) that performs the following tasks: Gather values of SYSRC() and SYSMSG() Gather the name of the executing module Issue a PUT _ALL_ to write all SCL variables to the log Pass the items gathered above, together with a unique serial number to help locate the line of source, to a frame The frame displays the information given to it together with some standard text to guide the user through handling this application failure. An example is shown below.
22 Notice that the frame does not offer an option to continue. The fatal error handler is only used for non-recoverable errors. The fact that no option to continue is offered means the programmer can simply continue coding after using %fatal - no ELSE statement is required. Without the need for an ELSE statement, the program does not tend to get so heavily indented as might otherwise be the case. As described, the fatal error handler is useful. However, it has additional functionality. When it detects that it is being run by a development programmer (based upon the value of a global macro variable, see "Conditional Debugging Messages"), it offers extra toolbar buttons. These buttons permit two valuable operations: the ability to open the failing module in edit mode at the failing line, and the ability to continue execution. The ability to be taken to the point of failure in the source code permits quick and easy understanding of the context of the problem, and an instant fix to the code (if appropriate). The ability to continue can be useful to the development programmer if %fatal has been called in error, perhaps due to a mis-coded IF statement. How it does it The fatal error handler consists of three components: the frame, the fatal macro, and the fatal initialisation macro. A listing of the basic (simplified) fatal macro follows. %macro fatal(text,frame=system.seugi99.fatal.frame ) ; pgm = screenname(); %if %length(&text) gt 0 %then %do; apptxt = &text; %end; %else %do; apptxt = ; %end; sysmsg = sysmsg(); sysrc = sysrc(); put "FATAL&_fat_id_:" " SYSRC=" sysrc " SYSMSG=" sysmsg " Application message=" apptxt " Program=" pgm ;
23 put _all_; call display("&frame", sysrc, sysmsg, apptxt,&_fat_id_, pgm ); %let _fat_id_ = %eval(&_fat_id_ + 1); %mend fatal; You will see that it increments a global macro variable named _FAT_ID_. The value of this macro variable is the unique identifier for the failing line of SCL, i.e. each invocation of %fatal within an SCL entry has a unique number. The macro variable is initialised and defined as global in the fatal initialisation macro. The fatal initialisation macro is listed following. %macro fatalin(start=1) ; %global _fat_id_; %let _fat_id_ = &start; %mend fatalin; The fatal initialisation macro must be invoked once in each module that uses the fatal macro. It must be invoked before the first invocation of %fatal. It contains no executable SCL statements, so it may be placed before any executable section of your SCL code. The final component is the fatal frame. Initially it places its parameters in the appropriate fields on the screen, and then it displays the appropriate toolbar. The "user toolbar" and the "programmer toolbar" are stored as SLISTs. At run-time, the fatal frame checks the value of the debug macro variable and instructs the toolbar widget to use the appropriate SLIST. When the Exit toolbar button is clicked, the fatal frame terminates the application by performing a GOTO to a null piece of SCL, i.e. an SCL module that contains only an INIT label and a RETURN statement. If the programmer s toolbar is available and the toolbar s go to error button is clicked, the fatal frame finds the failing line of SCL using the following code (where PROGRAM was passed by the caller of the frame). cmd = build!! program!! ; ; call execcmd(cmd); if scan(program,4) eq FRAME then do; call execcmd( src; ); end; cmd = find %fatalin ; ; call execcmd(cmd); do i=1 to errnum; cmd = find %fatal ; ;
24 call execcmd(cmd); end; The preceding code opens the SCL entry (via the frame entry if appropriate) and issues sufficient FIND commands for the string %fatal. The number of FIND commands is determined by the unique identifier number given to this particular invocation of %fatal - this was passed by the caller as ERRNUM. Those who haven t seen the fatal error handler before are often quite startled at the speed and simplicity with which an error can be solved using this go to error facility. Additional features The code for %fatal shown earlier is a cut-down version, for reasons of ease of understanding. The version that I use has a number of other optional parameters. Fatal errors in an application can occur due to a breakdown in the application s logic or assumptions. In these instances, the display of SYSRC and SYSMSG will not be appropriate, but the programmer would like the ability to supply his/her own message. The positional TEXT parameter of the macro (shown) provides the ability to add a message. If this value is not blank then an additional field is displayed near the bottom of the fatal frame (if not, the field is hidden). The full version of the macro also has a SYSCODES=Y parameter. This is used to indicate whether the values of SYSRC and SYSMSG should be gathered and displayed (by the macro and the frame). SYSCODES is passed to the frame. Usage in an object-oriented environment The fatal error handler can easily be incorporated into an object-oriented environment. In the root class for your application s classes, add a method named FATAL_ERROR. This method should be defined to run the fatal frame. The frame can pick-up parameters passed to the method using its ENTRY statement. The fatal macro now calls the FATAL_ERROR method on _SELF_ in order to invoke the frame. When the application is terminated, the _TERM_ method for each active object will execute. To prevent multiple displays of the fatal frame, I place a flag in the local list when the fatal macro is called. In subsequent calls, i.e. when the flag is already set, the fatal frame is not invoked. The following code begins the fatal macro. The ITEMNAME value is a parameter for the fatal macro that I default to TERMINATING_DUE_TO_FATAL_ERROR. if not nameditem(envlist( L ),"&itemname" ) then do; /* Handle fatal error */ /* Set our flag to avoid repeated calls */ if envlist( L ) ne insertc(envlist( L ), Y
25 ,-1,"&itemname" ) then put ERROR: FATAL could not set flag in local list ; continue with fatal macro Conclusion For me, the fatal error handler is "must have" in all applications. It provides benefits during development by capturing information and permitting a fast-path to the point of failure; and it provides benefits whilst the application is in production-use by presenting the user with a friendly and informative interface for handling fatal errors. As an alternative to using debug mode (in either SAS/AF or base SAS software) I often prefer to use copious PUT statements to tell me what's happening. This is fine until they have to be taken-out as the code nears completion. At that time, the task of removing them can be tedious, and I cannot be certain that I won't need each one any longer. To overcome this problem I use the technique described by Watts[1] as the Debug Flag. A global macro variable is used to indicate whether debugging messages and activities are required. Differing values can indicate the level of debugging required, for example 0 can indicate that no debugging information is required, 1 can indicate that messages are required, 2 can indicate that data sets should not be deleted. With respect to messages, I have a little macro that issues the PUT statement dependant upon the value of the macro variable. %macro dput(msg = /* Parms for PUT */,lvl = 0 /* Priority level of msg */,dmv = debug /* Name of debug macro var */ ); %global &dmv; %if &&&dmv ge &lvl %then %do; put &msg; %end; %mend dput; The default name of the macro variable is set to DEBUG, and the default comparison value is set to zero so that messages are always issued unless the value is less than zero (or has never been set). Three sample invocations are shown following /* DEBUG macro variable not yet set at all */ 14 data _null_; x = 10; %dput(msg= hello world x); 17 run;
26 NOTE: The DATA statement used 0.12 seconds %let debug=1; 21 data _null_; %dput(msg= hello world _n_); run; hello world 1 NOTE: The DATA statement used 0.09 seconds data _null_; 26 %dput(msg= hello Den Haag _n_, lvl=2); 27 run; NOTE: The DATA statement used 0.07 seconds. The first sample shows how no messages are output if the macro variable has not been set (such as would be the case in a production environment). The second example shows that the default message level results in the message being output if the macro variable is set to a positive number. The final example shows how the LVL parameter can be used to provide conditional outputting of messages. The sample macro I have shown does not work in a SAS/AF environment because it is resolved at compile-time. Thus, the PUT statement is included in the code if the DEBUG macro variable is set to a suitable value at compile-time. The value of the macro variable is not tested at run-time. To overcome this, you can use the following alternate macro with SAS/AF SCL. %macro dput(msg = /* Parms for PUT */,lvl = 0 /* Priority level of msg */,dmv = debug /* Name of debug macro var */ ); if symgetn("&dmv") ge &lvl then do; put &msg; end; %mend dput; Because the SYMGETN() function is used, the macro is SCL-specific, but if the IF statement were recoded as if inputn(symget("&dmv"), best. ) ge &lvl then then the macro would be universal, i.e. the same macro could be used in the SAS/AF and the base SAS environment. The drawback with this macro is that the IF statement must be evaluated at run-time, slowing down the application. Your particular circumstances will dictate whether you want two macros or one non-optimal version.
27 If performance is likely to be a problem in the production environment, you can "remove" the DPUT macro from your SCL and DATA steps by defining it as a null macro. You must then recompile your SCL. I have come across occasions where I ve shipped some amended code to a client and they subsequently say that they don t notice any difference in the behaviour of the code. On more than one of these occasions, the client had not installed the new version, or had installed it to the wrong location. To help me with remote analysis of such a situation, I developed a small and simple little SCL macro that would write the time of the module s compilation to the log at run-time. In the situation I have just described, it would immediately be clear that the old module was still being used. This diagnosis is achieved without guiding the client into viewing the SCL source code. I place the macro immediately following the INIT label of every frame, and in the _INIT_ method of every class. %macro sclinit (label=init); sn = screenname(); put "Running &label for" sn "compiled %sysfunc(datetime(),datetime.)"; put ; %mend sclinit; The macro is resolved into SCL at compile-time. The value of the DATETIME() function is also obtained and formatted at compile-time (by the %SYSFUNC() macro function). So, the SCL code at compile-time contains the hard-coded date/time of the compilation. Andrew Ratcliffe is a freelance SAS software consultant with over 15 years experience of SAS software. He specialises in object-oriented application development. Through his company (Ratcliffe Technical Services Limited), he is able to offer services including analysis and design consultancy, mentoring, training, and programming resources. Andrew can be contacted as detailed below: UK telephone: UK fax: International telephone: International fax: andrew@ratcliffe.demon.co.uk Web homepage:
28 [1] Watts, John An Application Development Application, SEUGI 94 Proceedings. SAS Institute.
Two Application Infrastructure Tools (Automated and Non-Volatile Locks)
Two Application Infrastructure Tools (Automated Email and Non-Volatile Locks) Andrew Ratcliffe Ratcliffe Technical Services Limited 1 Abstract The use of SAS software as an industrial-strength application
More informationError Trapping Techniques for SCL. Andrew Rosenbaum, Trilogy Consulting, Kalamazoo, MI
Paper 28-26 Error Trapping Techniques for SCL Andrew Rosenbaum, Trilogy Consulting, Kalamazoo, MI ABSTRACT An often-overlooked aspect of applications programming is error trapping. There are always unexpected
More informationUse SAS/AF, SCL and MACRO to Build User-friendly Applications on UNIX
Use SAS/AF, SCL and MACRO to Build User-friendly Applications on UNIX Minghui Yang, Ph.D, Boeing Logistics Market Research O. Introduction In the business application environment, many business analysts
More informationThe %let is a Macro command, which sets a macro variable to the value specified.
Paper 220-26 Structuring Base SAS for Easy Maintenance Gary E. Schlegelmilch, U.S. Dept. of Commerce, Bureau of the Census, Suitland MD ABSTRACT Computer programs, by their very nature, are built to be
More informationPrinting Envelopes in Microsoft Word
Printing Envelopes in Microsoft Word P 730 / 1 Stop Addressing Envelopes by Hand Let Word Print Them for You! One of the most common uses of Microsoft Word is for writing letters. With very little effort
More informationWhat you learned so far. Loops & Arrays efficiency for statements while statements. Assignment Plan. Required Reading. Objective 2/3/2018
Loops & Arrays efficiency for statements while statements Hye-Chung Kum Population Informatics Research Group http://pinformatics.org/ License: Data Science in the Health Domain by Hye-Chung Kum is licensed
More informationTesting is a very big and important topic when it comes to software development. Testing has a number of aspects that need to be considered.
Testing Testing is a very big and important topic when it comes to software development. Testing has a number of aspects that need to be considered. System stability is the system going to crash or not?
More informationSHARING SAS DATA INA PC LAN ENVIRONMENT. Tony Payne, SPS Ltd. ABSTRACT
I I SHARING SAS DATA INA PC LAN ENVIRONMENT Tony Payne, SPS Ltd. ABSTRACT F ' The SASe System, version 6.03 and beyond, provides powerful control of data editing sessions using the FSEDIT procedure with
More informationMacro Quoting: Which Function Should We Use? Pengfei Guo, MSD R&D (China) Co., Ltd., Shanghai, China
PharmaSUG China 2016 - Paper 81 Macro Quoting: Which Function Should We Use? Pengfei Guo, MSD R&D (China) Co., Ltd., Shanghai, China ABSTRACT There are several macro quoting functions in SAS and even some
More informationEarthwork 3D for Dummies Doing a digitized dirt takeoff calculation the swift and easy way
Introduction Earthwork 3D for Dummies Doing a digitized dirt takeoff calculation the swift and easy way Getting to know you Earthwork has inherited its layout from its ancestors, Sitework 98 and Edge.
More informationThe compiler is spewing error messages.
Appendix B Debugging There are a few different kinds of errors that can occur in a program, and it is useful to distinguish between them in order to track them down more quickly. Compile-time errors are
More informationFor example, let's say that we have the following functional specification:
FRAME IT: THE NUTS AND BOLTS OF RAD Marty Brown, CommScope, Inc., Claremont, NC INTRODUCTION The road to finishing a quality application does not have to be a long and confusing one. With the advent of
More informationMidterm Exam, October 24th, 2000 Tuesday, October 24th, Human-Computer Interaction IT 113, 2 credits First trimester, both modules 2000/2001
257 Midterm Exam, October 24th, 2000 258 257 Midterm Exam, October 24th, 2000 Tuesday, October 24th, 2000 Course Web page: http://www.cs.uni sb.de/users/jameson/hci Human-Computer Interaction IT 113, 2
More informationPrevent Pane - Moving from MENU & PROGRAM Entries to FRAME Entries Loretta Golby, ISM Alberta Serge Dupuis, BKD Software Consultants Edmonton, Alberta
Prevent Pane - Moving from MENU & PROGRAM Entries to FRAME Entries Loretta Golby, ISM Alberta Serge Dupuis, BKD Software Consultants ABSTRACT New releases of SAS software provide greater flexibility for
More information- a SAS/A~ Application
52 Advanced Tutorials Techniques for Sharing Screen Control Language Programs in - a SAS/A~ Application Derek Drummond, Jeff Phillips, and Veronica Walgamotte ARC Professional Services Group Introduction
More informationUsing Microsoft Excel to write SAS code Andrew Boyd, Quanticate, Edinburgh, UK
Using Microsoft Excel to write SAS code Andrew Boyd, Quanticate, Edinburgh, UK Often when we write SAS code in the pharmaceutical industry, there is a high level of repetition. This guide explains ways
More informationMacro Architecture in Pictures Mark Tabladillo PhD, marktab Consulting, Atlanta, GA Associate Faculty, University of Phoenix
Paper PS16_05 Macro Architecture in Pictures Mark Tabladillo PhD, marktab Consulting, Atlanta, GA Associate Faculty, University of Phoenix ABSTRACT The qualities which SAS macros share with object-oriented
More informationMacros I Use Every Day (And You Can, Too!)
Paper 2500-2018 Macros I Use Every Day (And You Can, Too!) Joe DeShon ABSTRACT SAS macros are a powerful tool which can be used in all stages of SAS program development. Like most programmers, I have collected
More informationCS558 Programming Languages
CS558 Programming Languages Winter 2018 Lecture 7b Andrew Tolmach Portland State University 1994-2018 Dynamic Type Checking Static type checking offers the great advantage of catching errors early And
More informationIntro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming
Intro to Programming Unit 7 Intro to Programming 1 What is Programming? 1. Programming Languages 2. Markup vs. Programming 1. Introduction 2. Print Statement 3. Strings 4. Types and Values 5. Math Externals
More informationCHAPTER 7 Using Other SAS Software Products
77 CHAPTER 7 Using Other SAS Software Products Introduction 77 Using SAS DATA Step Features in SCL 78 Statements 78 Functions 79 Variables 79 Numeric Variables 79 Character Variables 79 Expressions 80
More informationBuilding Routines. Quality Routines. Quality Routines. Quality Routines. Quality Routines. Routine. What makes a quality routine
Building Routines Routine individual function or procedure invocable for a single purpose What makes a quality routine easier to see a low quality routine low quality routine coming up Procedure HandleStuff(
More informationTechniques for Writing Robust SAS Macros. Martin Gregory. PhUSE Annual Conference, Oct 2009, Basel
Techniques for Writing Robust SAS Macros Martin Gregory PhUSE Annual Conference, 19-21 Oct 2009, Basel Overview Why robustness? Summary of techniques Types of macros considered An example from real life:
More informationExecuting SAS/AF Applications
53 CHAPTER 4 Executing SAS/AF Applications Overview 53 AF Command 53 Syntax 54 Requirement 54 Options 54 Using the AF Command 59 AFAPPLICATION Command 59 Syntax 59 Comparison with the AF Command 60 Sharing
More informationAnticipating User Issues with Macros
Paper PO01 Anticipating User Issues with Macros Lawrence Heaton-Wright, Quintiles, Bracknell, Berkshire, UK ABSTRACT How can you stop users asking you questions like: "What macros are available?" "Why
More informationRobust Memory Management Schemes
Robust Memory Management Schemes Prepared by : Fadi Sbahi & Ali Bsoul Supervised By: Dr. Lo ai Tawalbeh Jordan University of Science and Technology Robust Memory Management Schemes Introduction. Memory
More informationLecture 16 CSE July 1992
Lecture 16 CSE 110 28 July 1992 1 Dynamic Memory Allocation We are finally going to learn how to allocate memory on the fly, getting more when we need it, a subject not usually covered in introductory
More informationSAS Macro Design Issues Ian Whitlock, Westat
Paper 67-27 SAS Macro Design Issues Ian Whitlock, Westat Abstract Two questions motivated this paper. The first came more than twenty years ago at the end of my first programming course when the professor
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 informationCS61C Machine Structures. Lecture 4 C Pointers and Arrays. 1/25/2006 John Wawrzynek. www-inst.eecs.berkeley.edu/~cs61c/
CS61C Machine Structures Lecture 4 C Pointers and Arrays 1/25/2006 John Wawrzynek (www.cs.berkeley.edu/~johnw) www-inst.eecs.berkeley.edu/~cs61c/ CS 61C L04 C Pointers (1) Common C Error There is a difference
More informationA Maintenance-Free Menu Driven Closure System by Stephen M. Noga, Rho, Inc.
A Maintenance-Free Menu Driven Closure System by Stephen M. Noga, Rho, Inc. Introduction As a clinical trial nears closure, a series of data validation programs are run, sometimes individually, and sometimes
More informationXP: Backup Your Important Files for Safety
XP: Backup Your Important Files for Safety X 380 / 1 Protect Your Personal Files Against Accidental Loss with XP s Backup Wizard Your computer contains a great many important files, but when it comes to
More informationCATALOGER: An Application Development Tool to View, Compare, and Document SAS Catalogs and Data Files
CATALOGER: An Application Development Tool to View, Compare, and Document SAS Catalogs and Data Files Christopher A. Roper, Qualex Consulting Services, Inc., Fairfax, Va. Gina M. Thomas, Qualex Consulting
More informationMagic Tutorial #1: Getting Started
Magic Tutorial #1: Getting Started John Ousterhout (updated by others, too) Computer Science Division Electrical Engineering and Computer Sciences University of California Berkeley, CA 94720 This tutorial
More informationAgenda. Peer Instruction Question 1. Peer Instruction Answer 1. Peer Instruction Question 2 6/22/2011
CS 61C: Great Ideas in Computer Architecture (Machine Structures) Introduction to C (Part II) Instructors: Randy H. Katz David A. Patterson http://inst.eecs.berkeley.edu/~cs61c/sp11 Spring 2011 -- Lecture
More informationMicroservices Smaller is Better? Eberhard Wolff Freelance consultant & trainer
Microservices Smaller is Better? Eberhard Wolff Freelance consultant & trainer http://ewolff.com Why Microservices? Why Microservices? Strong modularization Replaceability Small units Sustainable Development
More informationStoring and Reusing Macros
101 CHAPTER 9 Storing and Reusing Macros Introduction 101 Saving Macros in an Autocall Library 102 Using Directories as Autocall Libraries 102 Using SAS Catalogs as Autocall Libraries 103 Calling an Autocall
More informationLESSON 13: LANGUAGE TRANSLATION
LESSON 13: LANGUAGE TRANSLATION Objective Interpreters and Compilers. Language Translation Phases. Interpreters and Compilers A COMPILER is a program that translates a complete source program into machine
More informationThe Three I s of SAS Log Messages, IMPORTANT, INTERESTING, and IRRELEVANT William E Benjamin Jr, Owl Computer Consultancy, LLC, Phoenix AZ.
ABSTRACT Paper TT_14 The Three I s of SAS Log Messages, IMPORTANT, INTERESTING, and IRRELEVANT William E Benjamin Jr, Owl Computer Consultancy, LLC, Phoenix AZ. I like to think that SAS error messages
More informationFSEDIT Procedure Windows
25 CHAPTER 4 FSEDIT Procedure Windows Overview 26 Viewing and Editing Observations 26 How the Control Level Affects Editing 27 Scrolling 28 Adding Observations 28 Entering and Editing Variable Values 28
More informationSAS/AF FRAME Entries: A Hands-on Introduction
SAS/AF FRAME Entries: A Hands-on Introduction Vincent L. Timbers The Pennsylvania State University, University Park, Pa. ABSTRACT Frame entries in SAS/AF use graphic display devices that enable application
More informationExploring Performance Tradeoffs in a Sudoku SAT Solver CS242 Project Report
Exploring Performance Tradeoffs in a Sudoku SAT Solver CS242 Project Report Hana Lee (leehana@stanford.edu) December 15, 2017 1 Summary I implemented a SAT solver capable of solving Sudoku puzzles using
More informationQUIZ. What is wrong with this code that uses default arguments?
QUIZ What is wrong with this code that uses default arguments? Solution The value of the default argument should be placed in either declaration or definition, not both! QUIZ What is wrong with this code
More informationHello World! Computer Programming for Kids and Other Beginners. Chapter 1. by Warren Sande and Carter Sande. Copyright 2009 Manning Publications
Hello World! Computer Programming for Kids and Other Beginners by Warren Sande and Carter Sande Chapter 1 Copyright 2009 Manning Publications brief contents Preface xiii Acknowledgments xix About this
More informationDavid S. Septoff Fidia Pharmaceutical Corporation
UNLIMITING A LIMITED MACRO ENVIRONMENT David S. Septoff Fidia Pharmaceutical Corporation ABSTRACT The full Macro facility provides SAS users with an extremely powerful programming tool. It allows for conditional
More informationMacro Internals for the User Developer s Overview. Susan O Connor, SAS Institute Inc., Cary, NC
Macro Internals for the User Developer s Overview Susan O Connor, SAS Institute Inc., Cary, NC ABSTRACT You have used the macro language software that is part of base software from SAS Institute Inc. or
More informationDesigning Accessible Help Systems
Designing Accessible Help Systems Cathy Brinsfield, Meridian Software, Inc. ABSTRACT SAS GUI applications can benefit greatly from well-designed, integrated help systems. This poster uses WinHelp to show
More informationGuidelines for Coding of SAS Programs Thomas J. Winn, Jr. Texas State Auditor s Office
Guidelines for Coding of SAS Programs Thomas J. Winn, Jr. Texas State Auditor s Office Abstract This paper presents a set of proposed guidelines that could be used for writing SAS code that is clear, efficient,
More informationCSE 331 Software Design & Implementation
CSE 331 Software Design & Implementation Hal Perkins Spring 2017 Exceptions and Assertions 1 Outline General concepts about dealing with errors and failures Assertions: what, why, how For things you believe
More informationThe Ins and Outs of %IF
Paper 1135-2017 The Ins and Outs of %IF M. Michelle Buchecker, ThotWave Technologies, LLC. ABSTRACT Have you ever had your macro code not work and you couldn't figure out why? Even something as simple
More informationLecture Notes on Contracts
Lecture Notes on Contracts 15-122: Principles of Imperative Computation Frank Pfenning Lecture 2 August 30, 2012 1 Introduction For an overview the course goals and the mechanics and schedule of the course,
More informationExcel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller
Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Table of Contents Introduction!... 1 Part 1: Entering Data!... 2 1.a: Typing!... 2 1.b: Editing
More informationChapter 1 Getting Started
Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different
More informationCS354 gdb Tutorial Written by Chris Feilbach
CS354 gdb Tutorial Written by Chris Feilbach Purpose This tutorial aims to show you the basics of using gdb to debug C programs. gdb is the GNU debugger, and is provided on systems that
More informationCreating a new form with check boxes, drop-down list boxes, and text box fill-ins. Customizing each of the three form fields.
In This Chapter Creating a new form with check boxes, drop-down list boxes, and text box fill-ins. Customizing each of the three form fields. Adding help text to any field to assist users as they fill
More informationMastering the Actuarial Tool Kit
Mastering the Actuarial Tool Kit By Sean Lorentz, ASA, MAAA Quick, what s your favorite Excel formula? Is it the tried and true old faithful SUMPRODUCT formula we ve all grown to love, or maybe once Microsoft
More informationIntroduction. A Brief Description of Our Journey
Introduction If you still write RPG code as you did 20 years ago, or if you have ILE RPG on your resume but don t actually use or understand it, this book is for you. It will help you transition from the
More informationCABC Max Document Management V1.1
CABC Max Document Management V1.1 Configuration Guide (Read this before you install Max Doc!) http://www.cabc.co.uk CABC Ltd 1999 Page 1 Introduction We have designed Max Doc to fit naturally into your
More informationAlgorithms in Systems Engineering IE172. Midterm Review. Dr. Ted Ralphs
Algorithms in Systems Engineering IE172 Midterm Review Dr. Ted Ralphs IE172 Midterm Review 1 Textbook Sections Covered on Midterm Chapters 1-5 IE172 Review: Algorithms and Programming 2 Introduction to
More informationIV-4Macros. Chapter IV-4
Chapter IV-4 IV-4Macros Overview... 108 Comparing Macros and Functions... 108 Macro Syntax... 110 The Defining Keyword... 110 The Procedure Name... 110 The Procedure Subtype... 110 The Parameter List and
More informationCD Assignment I. 1. Explain the various phases of the compiler with a simple example.
CD Assignment I 1. Explain the various phases of the compiler with a simple example. The compilation process is a sequence of various phases. Each phase takes input from the previous, and passes the output
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 informationDecisions, Decisions. Testing, testing C H A P T E R 7
C H A P T E R 7 In the first few chapters, we saw some of the basic building blocks of a program. We can now make a program with input, processing, and output. We can even make our input and output a little
More informationLecture Notes on Garbage Collection
Lecture Notes on Garbage Collection 15-411: Compiler Design Frank Pfenning Lecture 21 November 4, 2014 These brief notes only contain a short overview, a few pointers to the literature with detailed descriptions,
More informationMultiple Variable Drag and Drop Demonstration (v1) Steve Gannon, Principal Consultant GanTek Multimedia
Multiple Variable Drag and Drop Demonstration (v1) Steve Gannon, Principal Consultant GanTek Multimedia steve@gantekmultimedia.com Back Story An associate of mine, Marc Lee (a Flash coder and fellow Articulate
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 informationThe NetBeans IDE is a big file --- a minimum of around 30 MB. After you have downloaded the file, simply execute the file to install the software.
Introduction to Netbeans This document is a brief introduction to writing and compiling a program using the NetBeans Integrated Development Environment (IDE). An IDE is a program that automates and makes
More informationThere are a number of ways of doing this, and we will examine two of them. Fig1. Circuit 3a Flash two LEDs.
Flashing LEDs We re going to experiment with flashing some LEDs in this chapter. First, we will just flash two alternate LEDs, and then make a simple set of traffic lights, finally a running pattern; you
More informationRemembering the Past. Who Needs Documentation?
Remembering the Past Using SAS Keyboard Macros to Enhance Documentation Pete Lund Looking Glass Analytics Olympia, WA Who Needs Documentation? How many times have you looked at line after line of code
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 informationThe Perl Debugger. Avoiding Bugs with Warnings and Strict. Daniel Allen. Abstract
1 of 8 6/18/2006 7:36 PM The Perl Debugger Daniel Allen Abstract Sticking in extra print statements is one way to debug your Perl code, but a full-featured debugger can give you more information. Debugging
More informationMFC One Step At A Time By: Brandon Fogerty
MFC One Step At A Time 1 By: Brandon Fogerty Development Environment 2 Operating System: Windows XP/NT Development Studio: Microsoft.Net Visual C++ 2005 Step 1: 3 Fire up Visual Studio. Then go to File->New->Project
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 informationTaskbar: Working with Several Windows at Once
Taskbar: Working with Several Windows at Once Your Best Friend at the Bottom of the Screen How to Make the Most of Your Taskbar The taskbar is the wide bar that stretches across the bottom of your screen,
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 informationUsing Different Methods for Accessing Non-SAS Data to Build and Incrementally Update That Data Warehouse
Paper DM-01 Using Different Methods for Accessing Non-SAS Data to Build and Incrementally Update That Data Warehouse Abstract Ben Cochran, The Bedford Group, Raleigh, NC Often SAS users need to access
More informationExercises: Instructions and Advice
Instructions Exercises: Instructions and Advice The exercises in this course are primarily practical programming tasks that are designed to help the student master the intellectual content of the subjects
More informationHOT-Compilation: Garbage Collection
HOT-Compilation: Garbage Collection TA: Akiva Leffert aleffert@andrew.cmu.edu Out: Saturday, December 9th In: Tuesday, December 9th (Before midnight) Introduction It s time to take a step back and congratulate
More informationOrganizing your Outlook Inbox
Organizing your Outlook Inbox Tip 1: Filing system Tip 2: Create and name folders Tip 3: Folder structures Tip 4: Automatically organizing incoming emails into folders Tip 5: Using Colors Tip 6: Using
More informationDifferent Methods for Accessing Non-SAS Data to Build and Incrementally Update That Data Warehouse
Different Methods for Accessing Non-SAS Data to Build and Incrementally Update That Data Warehouse Ben Cochran, The Bedford Group, Raleigh, NC Abstract Often SAS users need to access data from non- SAS
More informationMobile App:IT. Methods & Classes
Mobile App:IT Methods & Classes WHAT IS A METHOD? - A method is a set of code which is referred to by name and can be called (invoked) at any point in a program simply by utilizing the method's name. -
More informationFinding and Fixing Bugs
C Finding and Fixing Bugs C.1 Introduction As you will quickly find the BUG is the pain of all programmers existence. This section looks at the most common types of BUGS and some of the strategies for
More informationProgram Validation: Logging the Log
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
More informationThink like an Elm developer
Think like an Elm developer Piper Niehaus Denver, CO, USA Backpacker / skier Nonprofit board chair Software Engineer at Pivotal Pivotal Tracker team Elm in Production since 2016 Internal Products and Services
More informationCSCI0330 Intro Computer Systems Doeppner. Lab 02 - Tools Lab. Due: Sunday, September 23, 2018 at 6:00 PM. 1 Introduction 0.
CSCI0330 Intro Computer Systems Doeppner Lab 02 - Tools Lab Due: Sunday, September 23, 2018 at 6:00 PM 1 Introduction 0 2 Assignment 0 3 gdb 1 3.1 Setting a Breakpoint 2 3.2 Setting a Watchpoint on Local
More informationMagic Tutorial #1: Getting Started
John Ousterhout Computer Science Division Electrical Engineering and Computer Sciences University of California Berkeley, CA 94720 (Updated by others, too.) This tutorial corresponds to Magic version 7.
More informationName: uteid: 1. CS439H: Fall 2011 Midterm 1
Name: uteid: 1 Instructions CS439H: Fall 2011 Midterm 1 Stop writing when time is announced at the end of the exam. I will leave the room as soon as I ve given people a fair chance to bring me the exams.
More informationIntro. Speed V Growth
Intro Good code is two things. It's elegant, and it's fast. In other words, we got a need for speed. We want to find out what's fast, what's slow, and what we can optimize. First, we'll take a tour of
More informationMULTIMEDIA TRAINING KIT INTRODUCTION TO OPENOFFICE.ORG WRITER HANDOUT
MULTIMEDIA TRAINING KIT INTRODUCTION TO OPENOFFICE.ORG WRITER HANDOUT Developed by: Anna Feldman for the Association for Progressive Communications (APC) MULTIMEDIA TRAINING KIT...1 INTRODUCTION TO OPENOFFICE.ORG
More informationThe Foundation. Review in an instant
The Foundation Review in an instant Table of contents Introduction 1 Basic use of Excel 2 - Important Excel terms - Important toolbars - Inserting and deleting columns and rows - Copy and paste Calculations
More informationPhotos with Text Reports on the Same SAS/AF Screen
Photos with Text Reports on the Same SAS/AF Screen Michael Shreve, American Honda Motor Company, Torrance, California Abstract The day of the digital media has arrived! Our field reps are armed with digital
More informationProject 3 Due October 21, 2015, 11:59:59pm
Project 3 Due October 21, 2015, 11:59:59pm 1 Introduction In this project, you will implement RubeVM, a virtual machine for a simple bytecode language. Later in the semester, you will compile Rube (a simplified
More informationProgramming Languages. Streams Wrapup, Memoization, Type Systems, and Some Monty Python
Programming Languages Streams Wrapup, Memoization, Type Systems, and Some Monty Python Quick Review of Constructing Streams Usually two ways to construct a stream. Method 1: Use a function that takes a(n)
More informationExceptions. CSE 142, Summer 2002 Computer Programming 1.
Exceptions CSE 142, Summer 2002 Computer Programming 1 http://www.cs.washington.edu/education/courses/142/02su/ 12-Aug-2002 cse142-19-exceptions 2002 University of Washington 1 Reading Readings and References»
More informationExceptions. Readings and References. Exceptions. Exceptional Conditions. Reading. CSE 142, Summer 2002 Computer Programming 1.
Readings and References Exceptions CSE 142, Summer 2002 Computer Programming 1 http://www.cs.washington.edu/education/courses/142/02su/ Reading» Chapter 18, An Introduction to Programming and Object Oriented
More informationThe DATA Statement: Efficiency Techniques
The DATA Statement: Efficiency Techniques S. David Riba, JADE Tech, Inc., Clearwater, FL ABSTRACT One of those SAS statements that everyone learns in the first day of class, the DATA statement rarely gets
More informationTopic 6: A Quick Intro To C
Topic 6: A Quick Intro To C Assumption: All of you know Java. Much of C syntax is the same. Also: Many of you have used C or C++. Goal for this topic: you can write & run a simple C program basic functions
More informationpublic class Foo { private int var; public int Method1() { // var accessible anywhere here } public int MethodN() {
Scoping, Static Variables, Overloading, Packages In this lecture, we will examine in more detail the notion of scope for variables. We ve already indicated that variables only exist within the block they
More informationRun-Time Environments/Garbage Collection
Run-Time Environments/Garbage Collection Department of Computer Science, Faculty of ICT January 5, 2014 Introduction Compilers need to be aware of the run-time environment in which their compiled programs
More informationAlias Macros, a Flexible Versioning System for Standard SAS Macros
Paper CS06 Alias Macros, a Flexible Versioning System for Standard SAS Macros Jean-Michel Bodart, UCB Pharma, Braine-l'Alleud, Belgium Guido Wendland, UCB Pharma, Monheim, Germany ABSTRACT The Alias Macros
More information