Once Written, Twice Applied: The Basics of Array Processing In SAS Elizabeth A. Roth, RAND Corporation, Santa Monica, CA

Size: px
Start display at page:

Download "Once Written, Twice Applied: The Basics of Array Processing In SAS Elizabeth A. Roth, RAND Corporation, Santa Monica, CA"

Transcription

1 Once Written, Twice Applied: The Basics of Array Processing In SAS Elizabeth A. Roth, RAND Corporation, Santa Monica, CA ABSTRACT Using arrays in DATA step programming can streamline programming in important ways. This paper introduces novice users to the basics of array processing through examples and explanations of syntax. In addition to the array statement, do-loop processing and the DIM function are discussed. Finally, several specific uses for arrays are described to help users get started programming with arrays. INTRODUCTION The power and flexibility of SAS DATA step programming is uncovered when one can reduce the amount of code written without sacrificing functionality, processing time, or readability. All programmers can appreciate the convenience of having fewer lines of code to write, document, and support. Arrays are one of the many tools SAS provides that allow programmers to streamline their code. The novice programmer who takes the time to add arrays to their kit of DATA step tools will be rewarded with elegant code that is easy to read, develop, and maintain. AN EXAMPLE The usefulness of arrays in DATA step programming is easily illustrated with an example. Let s say we have been asked to clean some data from a survey conducted by the local zoo, trying to investigate which animals patrons visited. Here is the survey question they might have administered: (1) Which animals did you see during your visit to the zoo today? Please check all that apply: Monkeys Giraffes Hippos Elephants Tapirs Zebras Orangutans None of the above Your data entry provider entered 12,000 surveys coding the checked boxes as 1 and the unchecked boxes as 2. You would like to store the unchecked boxes as zeros so you can compute means for each of the variables. Here is an example of how you might use the DATA step, without arrays, to recode the 2 s to 0 s: data animals; set zoosurvey ; /* Recode 2s to 0s */ if monkeys=2 then monkeys=0 ; if giraffes=2 then giraffes=0 ; if hippos=2 then hippos=0 ; if elephants=2 then elephants=0 ; if tapirs=2 then tapirs=0 ; if zebras=2 then zebras=0 ; if orangutans=2 then orangutans=0 ; run; This is a perfectly functional SAS program that will accomplish your recoding goal. It has the added benefit of being very clear in what is being recoded, however it is inflexible when you want to change how you are recoding every variable (imagine if you wanted to do a more complicated recoding procedure that required several lines of code per variable!) and it requires particularly good keyboarding skills (imagine you needed to recode the variables for each of the hundreds of animals in the zoo!). Arrays allow you to execute the exact same code for many different variables here is an example of how an array might simplify (and beautify!) the same code: 1

2 DATA animals; SET zoosurvey ; ARRAY animals {7} monkeys giraffes hippos elephants tapirs zebras orangutans ; /* Loop through all elements of the array */ DO i=1 TO 7 ; IF animals[i] = 2 THEN animals[i] = 0 ; RUN; This code is much more elegant: it uses fewer lines and requires much less repetition. THE MECHANICS OF THE ARRAY STATEMENT As seen in the example above, there are two parts to working with array statements: defining an array, and using it. In the example above, we used an array in the context of a do loop, referencing each element of the array from start to finish. In this section we ll talk about the specifics of defining and using, or referencing, arrays. There are at least four components to the array statement: the keyword ARRAY, a name that you define for the array, the dimension of the array, and the array elements themselves. Of course like every SAS statement, the ARRAY statement ends with a semicolon. We saw how to define an array for the zoo survey question above; here is another example of an array statement: ARRAY days {7} Monday Tuesday Wednesday Thursday Friday Saturday Sunday ; This statement creates an array called days that contains seven variables, or elements, which are the variables called Monday, Tuesday, Wednesday, etc. The number in curly brackets 1, {7}, is the dimension; this tells SAS how many elements will make up the array. Finally, the statement ends with a list of the variables that are the array s elements, followed by the semi-colon. SAS expects to find exactly the same number of variables listed as defined in the dimension. SAS also insists on finding variables of all the same type, either numeric or character, in the array definition. Implicit in the definition of an array is the fact that the variables are ordered in such a way that they can be referenced numerically, that is to say the first variable listed after the dimension (in this case Monday) is the first variable, the next one ( Tuesday ) is the second variable, the one following that ( Wednesday ) is the third variable, and so on. A variable s ordinal position in the array is called its index. So in this case, the index for the variable Thursday is 4, the index for Friday is 5, Saturday s is 6, and so on. A variable s index in an array is only relevant in the context of the array so if a variable appears in, say three arrays, the same variable will have three indices, one in the context of each array. The index is an important concept whenever you want to do anything with arrays. An element of the array is referenced by the array name plus its index, surrounded by brackets 2, like this: days[3] = 7 ; This code assigns the value seven to the Wednesday variable. Let s look at some code from our zoo example: ARRAY animals {7} monkeys giraffes hippos elephants tapirs zebras orangutans ; animals[2] = 0 ; This code recodes the giraffes variable (the second variable in the animals array) to zero. The index of the array (in the previous example it was 2) can be expressed as a digit (the number 2) or as a variable name, in which case SAS will substitute the current value of the variable. For example, we could create a variable 1 The dimension can be surrounded by parentheses, curly brackets, or straight brackets. I prefer to use curly brackets so as to avoid confusion with other SAS notation, such as function parameters. 2 Like the dimension, the index can be surrounded by parentheses, curly brackets, or straight brackets, but to avoid confusion I prefer to use straight brackets only. 2

3 whose value equals 2 and substitute the variable name as the index in the call to the array: /* Create a constant */ myvar = 2 ; /* Now use the constant */ animals[myvar] = 0 ; This code does exactly the same thing as the previous example: recodes the giraffes variable to zero. The ability to refer to an array s index by a variable name is the key to the power and flexibility of arrays. You can use SAS DO loops 3 to change the value of the index variable automatically, thus executing the same code on each variable in the array. This technique is probably the most common way to see calls to arrays. Let s look at another simple example from our days of the week array: /* Loop through all elements of the array */ DO myloopvar = 1 TO 7 ; IF days[myloopvar] = 1 THEN days[myloopvar] = 0 ; By incrementing the index variable from the starting value (1) through all values up until the stopping value (7) you execute the IF days[myloopvar] = 1 THEN days[myloopvar] = 0 line exactly seven times, once for each value of myloopvar, or in other words once for each element, or variable, in the array. Executing this code is equivalent to executing the following code: IF days[1] = 1 THEN days[1] = 0 ; IF days[2] = 1 THEN days[2] = 0 ; IF days[3] = 1 THEN days[3] = 0 ; IF days[4] = 1 THEN days[4] = 0 ; IF days[5] = 1 THEN days[5] = 0 ; IF days[6] = 1 THEN days[6] = 0 ; IF days[7] = 1 THEN days[7] = 0 ; which is exactly the same as executing this code: IF Monday = 1 THEN Monday = 0 ; IF Tuesday = 1 THEN Tuesday = 0 ; IF Wednesday = 1 THEN Wednesday = 0 ; IF Thursday = 1 THEN Thursday = 0 ; IF Friday = 1 THEN Friday = 0 ; IF Saturday = 1 THEN Saturday = 0 ; IF Sunday = 1 THEN Sunday = 0 ; only the version of the code using arrays is much more elegant. There is one last step we can take towards improving our ARRAY statement, which is to allow SAS to compute the stopping value of the DO loop, which is the dimension of the array, automatically. The SAS dim function does this, taking the name of an array as its only parameter and returning the array s dimension. Call the DIM function directly from the do loop and our elegant code becomes: do myloopvar = 1 to dim(days) ; if days[myloopvar] = 1 then days[myloopvar] = 0 ; end; Using the DIM function is useful in cases where the dimension of the array may change from time to time, as in the case with the zoo survey. Should we add 100 new animals to the list, we only need add them to the ARRAY statement and all of our looping code will compute the total number of items in the array at compile-time. However, if you know that the total number of elements in the array is relatively stable, it is preferable to simply enter the dimension as a constant. While there is probably a miniscule processing-time advantage to not having SAS 3 For the uninitiated, DO loops execute the same lines of code over and over again either a given number of times or until a certain condition has been met. The general form of the DO loop is: DO loopvar = 1 TO nloops ; code to be repeated ; 3

4 compute the dimension, it sometimes can be easier to debug array code when the dimension is entered as a constant. USES FOR ARRAYS You have seen how arrays can be powerful and yet simple to program. Let s look at a few uses for arrays that exploit their full capacity. This section demonstrates additional ways to define, call, or use arrays that just may solidify their place as one of your favorite tools in your programming toolbox. SETTING THE VALUES OF AN ARRAY S INDICES An array s index need not always begin at one. Indeed, you can define the dimension of an array in such as way that the indices are actually descriptive of the elements in the array. Say for example you conduct the Zoo survey in three consecutive months, May, June, and July, and you have entered the number of respondents in May, June, and July in a separate dataset [SHOW DATASET]. If you put these three variables into an array, it would make sense to have the index correspond to the month of the year. Simply defining the array as follows will accomplish exactly this: ARRAY nresp {5:7} may june july ; USING INDICES THAT MEAN SOMETHING The index of the variable may in the nresp array is 5, as opposed to 1. Now say you have a new set of observations and you d like to tally the months of their responses based on the survey date, survdate. This line of code will accomplish exactly that: nresp [ month(survdate) ] + 1 ; REFERENCING THE INDEX WITH A VARIABLE NAME, PART 2 In one of the above examples, we referenced a variable in the days array using a variable name for the index in the array call, as opposed to a constant ( animals[myvar] as opposed to animals[2], where myvar was set equal to 2). Naming the index variable cleverly can improve readability of the program substantially. Let s look, for example, at some code to top-code thirty years worth of respondents annual reports of their income: ARRAY income {1978:2007} income income2007 ; /* Loop over all elements of the array */ DO survyear = 1978 TO 2007 ; IF income[survyear] gt THEN income[survyear] = ; END ; Notice how the income array was defined using indices that correspond to the years the questions were asked (1978 through 2007), and the starting and stopping values for the do-loop correspond to those years 4. Now whenever you reference an element in the income array, you can use a meaningful index instead of an arbitrary one. This simplification can be particularly relevant when working with longitudinal or repeated-measures data, which can be particularly complex to process. ARRAYS AS FUNCTION PARAMETERS Once defined, you can use an array name to refer to all of the variables in an array at once, inside a function: mostsurveys = MAX (of nresp[*]) ; This code computes the max of the three variables, may, june, and july and stores it in the variable called mostsurveys. QUICKLY DEFINING ARRAYS FOR BLOCKS OF VARIABLES If you want to perform the same operation on all of the variables in a dataset, you can use the SAS reserved variable list names _NUMERIC_, _CHARACTER_, or _ALL_ to define the elements of an array: ARRAY numvars {*} _NUMERIC_ ; ARRAY charvars {*} _CHARVARS_ ; 4 As an aside, the DO-loop values only need to directly correspond to the dimension if you want to process all the variables in the array. If you want to process a subset of the variables in the array, simply process the indices you are interested in. 4

5 ARRAY allvars {*} _ALL_ ; Note, if you use _ALL_, all the variables in the dataset must have previously been defined as all the same data type. This application is the perfect example of when to allow SAS to compute the number of elements in the array on the fly, and when to use the DIM function in the looping code. CONCLUSION SAS arrays are an important basic programming tool that beginning users should take the time to acquire. Combined with do looping, arrays allow users to process multiple variables with the same code. Arrays can be passed to many SAS functions as a quick way to get information about the array, or the variables within the array. And there are several shortcuts that programmers can use to quickly define large blocks of variables as an array. Once learned, the ARRAY statement will be a tool that will serve to make your programs much more readable, effective, and generally more elegant. ACKNOWLEDGMENTS Thanks to Lara Hilton for the invitation to present and for the thoughtful read of this paper. CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: Elizabeth Roth RAND Corporation 1776 Main Street Santa Monica, CA (310) Elizabeth_Roth@rand.org SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. Other brand and product names are trademarks of their respective companies. 5

You deserve ARRAYs; How to be more efficient using SAS!

You deserve ARRAYs; How to be more efficient using SAS! ABSTRACT Paper 3259-2015 You deserve ARRAYs; How to be more efficient using SAS! Kate Burnett-Isaacs, Statistics Canada Everyone likes getting a raise, and using arrays in SAS can help you do just that!

More information

Chapter 6 Reacting to Player Input

Chapter 6 Reacting to Player Input Chapter 6 Reacting to Player Input 6.1 Introduction In this chapter, we will show you how your game program can react to mouse clicks and button presses. In order to do this, we need a instruction called

More information

How to approach a computational problem

How to approach a computational problem How to approach a computational problem A lot of people find computer programming difficult, especially when they first get started with it. Sometimes the problems are problems specifically related to

More information

Paper PS05_05 Using SAS to Process Repeated Measures Data Terry Fain, RAND Corporation Cyndie Gareleck, RAND Corporation

Paper PS05_05 Using SAS to Process Repeated Measures Data Terry Fain, RAND Corporation Cyndie Gareleck, RAND Corporation Paper PS05_05 Using SAS to Process Repeated Measures Data Terry Fain, RAND Corporation Cyndie Gareleck, RAND Corporation ABSTRACT Data that contain multiple observations per case are called repeated measures

More information

How Managers and Executives Can Leverage SAS Enterprise Guide

How Managers and Executives Can Leverage SAS Enterprise Guide Paper 8820-2016 How Managers and Executives Can Leverage SAS Enterprise Guide ABSTRACT Steven First and Jennifer First-Kluge, Systems Seminar Consultants, Inc. SAS Enterprise Guide is an extremely valuable

More information

Effectively Utilizing Loops and Arrays in the DATA Step

Effectively Utilizing Loops and Arrays in the DATA Step Paper 1618-2014 Effectively Utilizing Loops and Arrays in the DATA Step Arthur Li, City of Hope National Medical Center, Duarte, CA ABSTRACT The implicit loop refers to the DATA step repetitively reading

More information

Are Your SAS Programs Running You?

Are Your SAS Programs Running You? Overview Are Your SAS Programs Running You? Have you ever QUICKLY written some code assuming it will never be used again?? Is it now 5 years later and the SPAGHETTI CODE is still in production? Worse still

More information

Substitute Quick Reference (SmartFindExpress Substitute Calling System and Web Center)

Substitute Quick Reference (SmartFindExpress Substitute Calling System and Web Center) Substitute Quick Reference (SmartFindExpress Substitute Calling System and Web Center) System Phone Number 578-6618 Help Desk Phone Number 631-4868 (6:00 a.m. 4:30 p.m.) Write your Access number here Write

More information

Probably the best way to start learning a programming language is with a program. So here is our first program:

Probably the best way to start learning a programming language is with a program. So here is our first program: Structure of a C++ Program Probably the best way to start learning a programming language is with a program. So here is our first program: // my first program in C++ { cout

More information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 8: SEP. 29TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 8: SEP. 29TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 8: SEP. 29TH INSTRUCTOR: JIAYIN WANG 1 Notice Prepare the Weekly Quiz The weekly quiz is for the knowledge we learned in the previous week (both the

More information

Tips for Reducing Formula Size

Tips for Reducing Formula Size Tips for Reducing Formula Size Salesforce, Summer 17 @salesforcedocs Last updated: August 9, 2017 Copyright 2000 2017 salesforce.com, inc. All rights reserved. Salesforce is a registered trademark of salesforce.com,

More information

Macros I Use Every Day (And You Can, Too!)

Macros 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 information

JavaScript. Like PHP, JavaScript is a modern programming language that is derived from the syntax at C.

JavaScript. Like PHP, JavaScript is a modern programming language that is derived from the syntax at C. Like PHP, JavaScript is a modern programming language that is derived from the syntax at C. It has been around just about as long as PHP, also having been invented in 1995. JavaScript, HTML, and CSS make

More information

Chapter 2: Lists, Arrays and Dictionaries

Chapter 2: Lists, Arrays and Dictionaries Chapter 2: Lists, Arrays and Dictionaries 1. Higher order organization of data In the previous chapter, we have seen the concept of scalar variables that define memory space in which we store a scalar,

More information

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0. L J Howell UX Software Ver. 1.0

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0. L J Howell UX Software Ver. 1.0 VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 L J Howell UX Software 2009 Ver. 1.0 TABLE OF CONTENTS INTRODUCTION...ii What is this book about?... iii How to use this book... iii

More information

View a Students Schedule Through Student Services Trigger:

View a Students Schedule Through Student Services Trigger: Department Responsibility/Role File Name Version Document Generation Date 6/10/2007 Date Modified 6/10/2007 Last Changed by Status View a Students Schedule Through Student Services_BUSPROC View a Students

More information

DECISION CONTROL AND LOOPING STATEMENTS

DECISION CONTROL AND LOOPING STATEMENTS DECISION CONTROL AND LOOPING STATEMENTS DECISION CONTROL STATEMENTS Decision control statements are used to alter the flow of a sequence of instructions. These statements help to jump from one part of

More information

Connect to CCPL

Connect to CCPL TECH NEWS Want to receive this publication by email each month? Sign up for our monthly newsletter! Send your request in an email to techteam@ccpl.org with your full name and phone number. We ll add you

More information

Final Exam. Programming Assignment 3. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu. Readings

Final Exam. Programming Assignment 3. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu. Readings University of British Columbia CPSC 111, Intro to Computation Alan J. Hu Interfaces vs. Inheritance Abstract Classes Inner Classes Readings This Week: No new readings. Consolidate! (Reminder: Readings

More information

Title. Syntax. stata.com. datetime business calendars creation Business calendars creation

Title. Syntax. stata.com. datetime business calendars creation Business calendars creation Title statacom datetime business calendars creation Business calendars creation Syntax Description Remarks and examples Also see Syntax Business calendar calname and corresponding display format %tbcalname

More information

Lecture 1: Overview

Lecture 1: Overview 15-150 Lecture 1: Overview Lecture by Stefan Muller May 21, 2018 Welcome to 15-150! Today s lecture was an overview that showed the highlights of everything you re learning this semester, which also meant

More information

CSC 220: Computer Organization Unit 12 CPU programming

CSC 220: Computer Organization Unit 12 CPU programming College of Computer and Information Sciences Department of Computer Science CSC 220: Computer Organization Unit 12 CPU programming 1 Instruction set architectures Last time we built a simple, but complete,

More information

CISC-124. Dog.java looks like this. I have added some explanatory comments in the code, and more explanation after the code listing.

CISC-124. Dog.java looks like this. I have added some explanatory comments in the code, and more explanation after the code listing. CISC-124 20180115 20180116 20180118 We continued our introductory exploration of Java and object-oriented programming by looking at a program that uses two classes. We created a Java file Dog.java and

More information

Pseudocode. ARITHMETIC OPERATORS: In pseudocode arithmetic operators are used to perform arithmetic operations. These operators are listed below:

Pseudocode. ARITHMETIC OPERATORS: In pseudocode arithmetic operators are used to perform arithmetic operations. These operators are listed below: Pseudocode There are 3 programming/pseudocode constructs: 1. Sequence: It refers that instructions should be executed one after another. 2. Selection: This construct is used to make a decision in choosing

More information

%Addval: A SAS Macro Which Completes the Cartesian Product of Dataset Observations for All Values of a Selected Set of Variables

%Addval: A SAS Macro Which Completes the Cartesian Product of Dataset Observations for All Values of a Selected Set of Variables %Addval: A SAS Macro Which Completes the Cartesian Product of Dataset Observations for All Values of a Selected Set of Variables Rich Schiefelbein, PRA International, Lenexa, KS ABSTRACT It is often useful

More information

Chapter 3: Working With Your Data

Chapter 3: Working With Your Data Chapter 3: Working With Your Data Creating variables based on other variables is easily done within the data step. Assignment is carried out with the = sign. Example: INPUT var1 var2 var3; mysum = var1

More information

Information Science 1

Information Science 1 Topics covered Information Science 1 Terms and concepts from Week 8 Simple calculations Documenting programs Simple Calcula,ons Expressions Arithmetic operators and arithmetic operator precedence Mixed-type

More information

Marketing Benchmark Survey 2004

Marketing Benchmark Survey 2004 Email Marketing Benchmark Survey 2004 1. What percentage of your total marketing budget is currently devoted to email marketing? 25%

More information

San Diego Unified School District Substitute Reference Guide

San Diego Unified School District Substitute Reference Guide San Diego Unified School District Substitute Reference Guide System Phone Number (619) 297-0304 Help Desk Phone Number (619) 725-8090 Write your PIN here Web Browser URL https://subweb.sandi.net THE SYSTEM

More information

Lesson 6A Loops. By John B. Owen All rights reserved 2011, revised 2014

Lesson 6A Loops. By John B. Owen All rights reserved 2011, revised 2014 Lesson 6A Loops By John B. Owen All rights reserved 2011, revised 2014 Topic List Objectives Loop structure 4 parts Three loop styles Example of a while loop Example of a do while loop Comparison while

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Excel contains numerous tools that are intended to meet a wide range of requirements. Some of the more specialised tools are useful to only certain types of people while others have

More information

Beyond IF THEN ELSE: Techniques for Conditional Execution of SAS Code Joshua M. Horstman, Nested Loop Consulting, Indianapolis, IN

Beyond IF THEN ELSE: Techniques for Conditional Execution of SAS Code Joshua M. Horstman, Nested Loop Consulting, Indianapolis, IN Beyond IF THEN ELSE: Techniques for Conditional Execution of SAS Code Joshua M. Horstman, Nested Loop Consulting, Indianapolis, IN ABSTRACT Nearly every SAS program includes logic that causes certain code

More information

Helping You C What You Can Do with SAS

Helping You C What You Can Do with SAS ABSTRACT Paper SAS1747-2015 Helping You C What You Can Do with SAS Andrew Henrick, Donald Erdman, and Karen Croft, SAS Institute Inc., Cary, NC SAS users are already familiar with the FCMP procedure and

More information

Getting Started with Calendaring Author: Teresa Sakata

Getting Started with Calendaring Author: Teresa Sakata INET1001 May 2009 Getting Started with Calendaring Author: Teresa Sakata Introduction...1 Overview...1 Setting Global Calendar Options...4 Creating a new event...6 Creating a new task...8 Setting the Repeat

More information

Using an Array as an If-Switch Nazik Elgaddal and Ed Heaton, Westat, Rockville, MD

Using an Array as an If-Switch Nazik Elgaddal and Ed Heaton, Westat, Rockville, MD Using an Array as an If-Switch Nazik Elgaddal and Ed Heaton, Westat, Rockville, MD Abstract Do you sometimes find yourself using nested IF statements or nested SELECT blocks? Does the code become more

More information

Remotely Test Any Networked Equipment

Remotely Test Any Networked Equipment 1 Remotely Test Any Networked Equipment Universal Test Head Platform includes: Multiple Test Heads Scheduler Resource Balancing Database: Equipment Links Equipment History Test History Test Library Windows

More information

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. List the elements in the set. 1) {x x is a whole number between 1 and 5} A) {2, 3, 4} B) {1, 2, 3,

More information

} Evaluate the following expressions: 1. int x = 5 / 2 + 2; 2. int x = / 2; 3. int x = 5 / ; 4. double x = 5 / 2.

} Evaluate the following expressions: 1. int x = 5 / 2 + 2; 2. int x = / 2; 3. int x = 5 / ; 4. double x = 5 / 2. Class #10: Understanding Primitives and Assignments Software Design I (CS 120): M. Allen, 19 Sep. 18 Java Arithmetic } Evaluate the following expressions: 1. int x = 5 / 2 + 2; 2. int x = 2 + 5 / 2; 3.

More information

Example. Section: PS 709 Examples of Calculations of Reduced Hours of Work Last Revised: February 2017 Last Reviewed: February 2017 Next Review:

Example. Section: PS 709 Examples of Calculations of Reduced Hours of Work Last Revised: February 2017 Last Reviewed: February 2017 Next Review: Following are three examples of calculations for MCP employees (undefined hours of work) and three examples for MCP office employees. Examples use the data from the table below. For your calculations use

More information

CS125 : Introduction to Computer Science. Lecture Notes #6 Compound Statements, Scope, and Advanced Conditionals

CS125 : Introduction to Computer Science. Lecture Notes #6 Compound Statements, Scope, and Advanced Conditionals CS125 : Introduction to Computer Science Lecture Notes #6 Compound Statements, Scope, and Advanced Conditionals c 2005, 2004, 2003, 2002, 2001, 2000 Jason Zych 1 Lecture 6 : Compound Statements, Scope,

More information

PROGRAMMING CONCEPTS

PROGRAMMING CONCEPTS ch01.qxd 9/19/02 9:17 AM Page 1 C H A P T E R 1 PROGRAMMING CONCEPTS CHAPTER OBJECTIVES In this Chapter, you will learn about: The Nature of a Computer Program and Programming Languages Page 2 Good Programming

More information

CHRIST THE KING BOYS MATRIC HR. SEC. SCHOOL, KUMBAKONAM CHAPTER 9 C++

CHRIST THE KING BOYS MATRIC HR. SEC. SCHOOL, KUMBAKONAM CHAPTER 9 C++ CHAPTER 9 C++ 1. WRITE ABOUT THE BINARY OPERATORS USED IN C++? ARITHMETIC OPERATORS: Arithmetic operators perform simple arithmetic operations like addition, subtraction, multiplication, division etc.,

More information

Lesson 1: Writing Your First JavaScript

Lesson 1: Writing Your First JavaScript JavaScript 101 1-1 Lesson 1: Writing Your First JavaScript OBJECTIVES: In this lesson you will be taught how to Use the tag Insert JavaScript code in a Web page Hide your JavaScript

More information

Solar Eclipse Scheduler. Release 9.0

Solar Eclipse Scheduler. Release 9.0 Solar Eclipse Scheduler Release 9.0 Disclaimer This document is for informational purposes only and is subject to change without notice. This document and its contents, including the viewpoints, dates

More information

Lecture Outline. Rainfall Solution Attempt 1. Motivation for arrays. Introducing the Array. Motivation

Lecture Outline. Rainfall Solution Attempt 1. Motivation for arrays. Introducing the Array. Motivation Lecture Outline IMS1906 Programming in VB.NET Week 7 Lecture 1 & 2 Introduction to Arrays Arrays Part 1 and II Angela Carbone Monash University School of Information Management and Systems Defining Arrays

More information

Math 202 Test Problem Solving, Sets, and Whole Numbers 19 September, 2008

Math 202 Test Problem Solving, Sets, and Whole Numbers 19 September, 2008 Math 202 Test Problem Solving, Sets, and Whole Numbers 19 September, 2008 Ten questions, each worth the same amount. Complete six of your choice. I will only grade the first six I see. Make sure your name

More information

2013 Association Marketing Benchmark Report

2013 Association  Marketing Benchmark Report 2013 Association Email Marketing Benchmark Report Part I: Key Metrics 1 TABLE of CONTENTS About Informz.... 3 Introduction.... 4 Key Findings.... 5 Overall Association Metrics... 6 Results by Country of

More information

Microsoft Excel 2013 Series and Custom Lists (Level 3)

Microsoft Excel 2013 Series and Custom Lists (Level 3) IT Training Microsoft Excel 2013 Series and Custom Lists (Level 3) Contents Introduction...1 Extending a Single Cell...1 Built-in Data Series...2 Extending Two Cells...2 Extending Multiple Cells...3 Linear

More information

Maximizing the Power of Excel With Macros and Modules

Maximizing the Power of Excel With Macros and Modules Maximizing the Power of Excel With Macros and Modules Produced by SkillPath Seminars The Smart Choice 6900 Squibb Road P.O. Box 2768 Mission, KS 66201-2768 1-800-873-7545 www.skillpath.com Maximizing the

More information

GET TO KNOW YOUR HOME PHONE

GET TO KNOW YOUR HOME PHONE telstra.com/homephone visit a telstra store 13 2200 HOME FEATURES USER GUIDE GET TO KNOW YOUR HOME PHONE C020 OCT13 ENJOY FEATURES THAT MAKE LIFE EASIER Home features make it easy for you to do more with

More information

The Ins and Outs of %IF

The 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 information

12. Pointers Address-of operator (&)

12. Pointers Address-of operator (&) 12. Pointers In earlier chapters, variables have been explained as locations in the computer's memory which can be accessed by their identifer (their name). This way, the program does not need to care

More information

ID-AL - SCHEDULER V2.x - Time-stamped & dated programming Scheduler - Manual SCHEDULER. V2.x MANUAL

ID-AL - SCHEDULER V2.x - Time-stamped & dated programming Scheduler - Manual SCHEDULER. V2.x MANUAL SCHEDULER V2.x MANUAL Waves System Table of Contents 1 - Introduction... p1 Required configuration... p2 Installation of the software Scheduler... p2 2 - Presentation of the Scheduler Window... p3 Main

More information

Webinar Benchmarks Report

Webinar Benchmarks Report ON24 BENCHMARKS ON24 BENCHMARKS REPORT REPORT ON24 Webinar Benchmarks Report 2015 EMEA EDITION ON24 Webinar Benchmarks Report 2015 edition 1 TABLE OF CONTENTS EXECUTIVE SUMMARY 03 METHODOLOGY PRE-WEBINAR

More information

Math in Focus Vocabulary. Kindergarten

Math in Focus Vocabulary. Kindergarten Math in Focus Vocabulary Kindergarten Chapter Word Definition 1 one 1 * 1 two 2 * * 1 three 3 * * * 1 four 4 * * * * 1 five 5 * * * * * 1 same things that have a common property 1 different things that

More information

SAS Macro Programming for Beginners

SAS Macro Programming for Beginners ABSTRACT SAS Macro Programming for Beginners Lora D. Delwiche, Winters, CA Susan J. Slaughter, Avocet Solutions, Davis, CA Macro programming is generally considered an advanced topic. But, while macros

More information

Midterms Save the Dates!

Midterms Save the Dates! University of British Columbia CPSC 111, Intro to Computation Alan J. Hu (Using the Scanner and String Classes) Anatomy of a Java Program Readings This Week s Reading: Ch 3.1-3.8 (Major conceptual jump

More information

Scheduling WebEx Meetings with Microsoft Outlook

Scheduling WebEx Meetings with Microsoft Outlook Scheduling WebEx Meetings with Microsoft Outlook About WebEx Integration to Outlook, page 1 Scheduling a WebEx Meeting from Microsoft Outlook, page 2 Starting a Scheduled Meeting from Microsoft Outlook,

More information

Connect to CCPL

Connect to CCPL Connect to Tech @ CCPL Charleston County Public Library July August September 2015 Technology Training Catalog TECH NEWS Want to receive this publication by email each month? Sign up for our monthly newsletter!

More information

HW3: CS 110X C Domain Information. Final Version: 1/29/2014

HW3: CS 110X C Domain Information. Final Version: 1/29/2014 HW3: CS 110X C 2014 Note: This homework (and all remaining homework assignments) is a partner homework and must be completed by each partner pair. When you complete this assignment, you must not share

More information

GreenThumb Garden Registration

GreenThumb Garden Registration GreenThumb Garden Registration 2015-2019 Garden Name Block Lot CB Jurisdiction Two members must provide full contact information on the license agreement, including phone numbers, addresses and emails.

More information

Other conditional and loop constructs. Fundamentals of Computer Science Keith Vertanen

Other conditional and loop constructs. Fundamentals of Computer Science Keith Vertanen Other conditional and loop constructs Fundamentals of Computer Science Keith Vertanen Overview Current loop constructs: for, while, do-while New loop constructs Get out of loop early: break Skip rest of

More information

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA 1 TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson, and instructor materials prepared

More information

TutorTrac for Staff LOGINS: Kiosk Login Setting up the Kiosk for Student Login:

TutorTrac for Staff LOGINS: Kiosk Login Setting up the Kiosk for Student Login: LOGINS: TutorTrac for Staff Kiosk Login Setting up the Kiosk for Student Login: Click on the TutorTrac icon: This goes to http://tutortrac.davenport.edu (or type in the URL, if the shortcut is not available).

More information

ONLINE AND MOBILE BANKING INFORMATIONAL GUIDE. Retain for easy reference.

ONLINE AND MOBILE BANKING INFORMATIONAL GUIDE. Retain for easy reference. ONLINE AND MOBILE BANKING INFORMATIONAL GUIDE Retain for easy reference. Contents Important dates... 3 Welcome! We are pleased to deliver enhanced online and mobile banking services to you, as part of

More information

Getting started 7. Setting properties 23

Getting started 7. Setting properties 23 Contents 1 2 3 Getting started 7 Introduction 8 Installing Visual Basic 10 Exploring the IDE 12 Starting a new project 14 Adding a visual control 16 Adding functional code 18 Saving projects 20 Reopening

More information

While You Were Sleeping - Scheduling SAS Jobs to Run Automatically Faron Kincheloe, Baylor University, Waco, TX

While You Were Sleeping - Scheduling SAS Jobs to Run Automatically Faron Kincheloe, Baylor University, Waco, TX While You Were Sleeping - Scheduling SAS Jobs to Run Automatically Faron Kincheloe, Baylor University, Waco, TX ABSTRACT If you are tired of running the same jobs over and over again, this paper is for

More information

Year 1 and 2 Mastery of Mathematics

Year 1 and 2 Mastery of Mathematics Year 1 and 2 Mastery of Mathematics Mastery of the curriculum requires that all pupils:. use mathematical concepts, facts and procedures appropriately, flexibly and fluently; recall key number facts with

More information

EEN118 22nd November These are my answers. Extra credit for anyone who spots a mistike. Except for that one. I did it on purpise.

EEN118 22nd November These are my answers. Extra credit for anyone who spots a mistike. Except for that one. I did it on purpise. EEN118 22nd November 2011 These are my answers. Extra credit for anyone who spots a mistike. Except for that one. I did it on purpise. 5. An automatic animal monitoring device sits in the african savannah

More information

Information Science 1

Information Science 1 Information Science 1 Simple Calcula,ons Week 09 College of Information Science and Engineering Ritsumeikan University Topics covered l Terms and concepts from Week 8 l Simple calculations Documenting

More information

Local Register Allocation (critical content for Lab 2) Comp 412

Local Register Allocation (critical content for Lab 2) Comp 412 Updated After Tutorial COMP 412 FALL 2018 Local Register Allocation (critical content for Lab 2) Comp 412 source code IR Front End Optimizer Back End IR target code Copyright 2018, Keith D. Cooper & Linda

More information

Private Swimming Lessons

Private Swimming Lessons Private Swimming Lessons Private Lessons Designed for participants who would like a 1:1 ratio. Participants will receive individual attention to improve their swimming technique and have the convenience

More information

Programming IDL for Astronomy September 6, 2004

Programming IDL for Astronomy September 6, 2004 Programming IDL for Astronomy September 6, 2004 Marshall Perrin 1 1. Introduction This is not a programming course, but nonetheless it will involve a lot of programming. This is true of astronomy as a

More information

1/22/2017. Chapter 2. Functions and Control Structures. Calling Functions. Objectives. Defining Functions (continued) Defining Functions

1/22/2017. Chapter 2. Functions and Control Structures. Calling Functions. Objectives. Defining Functions (continued) Defining Functions Chapter 2 Functions and Control Structures PHP Programming with MySQL 2 nd Edition Objectives In this chapter, you will: Study how to use functions to organize your PHP code Learn about variable scope

More information

9.2 Linux Essentials Exam Objectives

9.2 Linux Essentials Exam Objectives 9.2 Linux Essentials Exam Objectives This chapter will cover the topics for the following Linux Essentials exam objectives: Topic 3: The Power of the Command Line (weight: 10) 3.3: Turning Commands into

More information

Programming Language. Control Structures: Selection (switch) Eng. Anis Nazer First Semester

Programming Language. Control Structures: Selection (switch) Eng. Anis Nazer First Semester Programming Language Control Structures: Selection (switch) Eng. Anis Nazer First Semester 2018-2019 Multiple selection choose one of two things if/else choose one from many things multiple selection using

More information

ENVIRONMENT MODEL: FUNCTIONS, DATA 18

ENVIRONMENT MODEL: FUNCTIONS, DATA 18 ENVIRONMENT MODEL: FUNCTIONS, DATA 18 COMPUTER SCIENCE 61A Jon Kotker and Tom Magrino July 18, 2012 1 Motivation Yesterday, we introduced the environment model of computation as an alternative to the earlier

More information

1 Lecture 5: Advanced Data Structures

1 Lecture 5: Advanced Data Structures L5 June 14, 2017 1 Lecture 5: Advanced Data Structures CSCI 1360E: Foundations for Informatics and Analytics 1.1 Overview and Objectives We ve covered list, tuples, sets, and dictionaries. These are the

More information

Programming in ROBOTC ROBOTC Rules

Programming in ROBOTC ROBOTC Rules Programming in ROBOTC ROBOTC Rules In this lesson, you will learn the basic rules for writing ROBOTC programs. ROBOTC is a text-based programming language Commands to the robot are first written as text

More information

T H E I N T E R A C T I V E S H E L L

T H E I N T E R A C T I V E S H E L L 3 T H E I N T E R A C T I V E S H E L L The Analytical Engine has no pretensions whatever to originate anything. It can do whatever we know how to order it to perform. Ada Lovelace, October 1842 Before

More information

Pearson BTEC Level 3 Nationals External Assessment Examination Timetable for Paper-based examinations and Set Tasks 2017 FINAL

Pearson BTEC Level 3 Nationals External Assessment Examination Timetable for Paper-based examinations and Set Tasks 2017 FINAL Pearson BTEC Level 3 Nationals External Assessment Examination Timetable for Paper-based examinations and Set Tasks 2017 FINAL For more information on Pearson qualifications please visit http://qualifications.pearson.com

More information

CHAPTER : 9 FLOW OF CONTROL

CHAPTER : 9 FLOW OF CONTROL CHAPTER 9 FLOW OF CONTROL Statements-Statements are the instructions given to the Computer to perform any kind of action. Null Statement-A null statement is useful in those case where syntax of the language

More information

ALTEVA ARCHIVE USER GUIDE

ALTEVA ARCHIVE USER GUIDE ALTEVA ARCHIVE USER GUIDE Welcome This guide provides information about Alteva s SmartRecord IP End-User Interface features, functions, and reports presented as tools to be used to solve your business

More information

Coding Workshop. Learning to Program with an Arduino. Lecture Notes. Programming Introduction Values Assignment Arithmetic.

Coding Workshop. Learning to Program with an Arduino. Lecture Notes. Programming Introduction Values Assignment Arithmetic. Coding Workshop Learning to Program with an Arduino Lecture Notes Table of Contents Programming ntroduction Values Assignment Arithmetic Control Tests f Blocks For Blocks Functions Arduino Main Functions

More information

Fundamentals of Programming Session 4

Fundamentals of Programming Session 4 Fundamentals of Programming Session 4 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Fall 2011 These slides are created using Deitel s slides, ( 1992-2010 by Pearson Education, Inc).

More information

SAS Business Rules Manager 1.2

SAS Business Rules Manager 1.2 SAS Business Rules Manager 1.2 User s Guide Second Edition SAS Documentation The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2012. SAS Business Rules Manager 1.2. Cary,

More information

ENGLISH TYPE 40 OPERATING INSTRUCTIONS

ENGLISH TYPE 40 OPERATING INSTRUCTIONS ENGLISH TYPE 40 OPERATING INSTRUCTIONS 1 www.division-furtive.com 2011-2014 Division Furtive All Rights Reserved 20140521 2 Content ENGLISH Initial activation Basic operation Setting the watch Advanced

More information

JAVASCRIPT - CREATING A TOC

JAVASCRIPT - CREATING A TOC JAVASCRIPT - CREATING A TOC Problem specification - Adding a Table of Contents. The aim is to be able to show a complete novice to HTML, how to add a Table of Contents (TOC) to a page inside a pair of

More information

C Language Programming

C Language Programming Experiment 2 C Language Programming During the infancy years of microprocessor based systems, programs were developed using assemblers and fused into the EPROMs. There used to be no mechanism to find what

More information

10/9/2012. Comparison and Logical Operators The if Statement The if else Statement Nested if Statements The switch case. switch case Statement

10/9/2012. Comparison and Logical Operators The if Statement The if else Statement Nested if Statements The switch case. switch case Statement 1. 2. 3. 4. I l Implementing ti Control C t ll Logic i iin C# 5 5. Comparison and Logical Operators The if Statement The if Statement Nested if Statements The switch case switch case Statement 2 Operator

More information

Different 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 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 information

Simplified Operating Instructions T105-C / T108-C / T106-C / T17B-C DISPLAYS DAY OR DAY BLOCK PROG 00:0000 PROG PROG ALWAYS OFF

Simplified Operating Instructions T105-C / T108-C / T106-C / T17B-C DISPLAYS DAY OR DAY BLOCK PROG 00:0000 PROG PROG ALWAYS OFF Button Operations Simplified Operating Instructions T105-C / T108-C / T106-C / T17B-C R - Reset (with pen or other pointed instrument). Y - Enters function setup. +/- Buttons to scroll through icons. Y

More information

Assignment 3: Optimizing solutions

Assignment 3: Optimizing solutions Assignment 3: Optimizing solutions Algorithmic Thinking and Structured Programming (in Greenfoot) c 2015 Renske Smetsers-Weeda & Sjaak Smetsers Licensed under the Creative Commons Attribution 4.0 license,

More information

Announcements Wednesday, August 23

Announcements Wednesday, August 23 Announcements Wednesday, August 23 Everything you ll need to know is on the master website: http://people.math.gatech.edu/~cjankowski3/teaching/f2017/m1553/index.html or on the website for this section:

More information

Simple Java Scripts for Teaching Basic Computer Programming Skills

Simple Java Scripts for Teaching Basic Computer Programming Skills Technology Education Activity: Simple Java Scripts for Teaching Basic Computer Programming Skills Technology education teachers are being challenged to teach their students in a realistic and simple manner

More information

Basic Programming Language Syntax

Basic Programming Language Syntax Java Created in 1990 by Sun Microsystems. Free compiler from Sun, commercial from many vendors. We use free (Sun) Java on UNIX. Compiling and Interpreting...are processes of translating a high-level programming

More information

Lab 6 Vectors and functions

Lab 6 Vectors and functions CMSC160 Intro to Algorithmic Design Blaheta Lab 6 Vectors and functions 11 October 2016 The drill for this lab is another part of the Chapter 4 drill. Come to lab on Tuesday either with it completed or

More information

SAS Clinical Data Integration 2.4

SAS Clinical Data Integration 2.4 SAS Clinical Data Integration 2.4 User s Guide SAS Documentation The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2013. SAS Clinical Data Integration 2.4: User's Guide.

More information

Exercises Software Development I. 02 Algorithm Testing & Language Description Manual inspection, test plan, grammar, metasyntax notations (BNF, EBNF)

Exercises Software Development I. 02 Algorithm Testing & Language Description Manual inspection, test plan, grammar, metasyntax notations (BNF, EBNF) Exercises Software Development I 02 Algorithm Testing & Language Description Manual inspection, test plan, grammar, metasyntax notations (BNF, EBNF) October 15th, 2014 Software Development I Winter term

More information

EGR 111 Introduction to MATLAB

EGR 111 Introduction to MATLAB EGR 111 Introduction to MATLAB This lab introduces the MATLAB help facility, shows how MATLAB TM, which stands for MATrix LABoratory, can be used as an advanced calculator. This lab also introduces assignment

More information