Simple File Input & Output

Size: px
Start display at page:

Download "Simple File Input & Output"

Transcription

1 Simple File Input & Output Handout Eight Although we are looking at file I/O (Input/Output) rather late in this course, it is actually one of the most important features of any programming language. The ability of a program to communicate small or very large amounts of data to itself or another program at a known or unknown later date is of great importance. Fortran 90 has a wealth of commands for I/O and in this course we will only study a few of them. For example your matrix library module could be written so that it could write and read matrices to and from files saving you the trouble of having to type it in from the keyboard every time you run a code. We will look briefly at two types of files, formatted and unformatted files. 1 The OPEN statement Before we can READ from or WRITE to a file the file must first be opened and a UNIT number assigned to it. The general form of the OPEN statement is OPEN(specification list ) the specification list is a comma separated list of specifiers that determine how the file should be opened. The list below contains the specifiers you need to know for this course but be aware that there are many more. UNIT = unit number FILE = file name FORM = file type STATUS = file status ACTION = allowed actions The specifiers are explained below. unit number : This must be present and takes any integer type. Note this number identifies the file and must be unique so if you have more than one file open then you must specify a different unit number for each file. Avoid using 0,5 or 6 as these UNITs are typically picked to be used by Fortran as follows. Standard Error = 0 : Used to print error messages to the screen. Standard In = 5 : Used to read in data from the keyboard. Standard Out = 6 : Used to print general output to the screen. file name : A string that holds the name of the file which we would like to open. There are situations in Fortran where you do not need to specify a file name, however this course will not require them so a file name will always be required. file type : A string that holds the type of file that we would like to open, ie FORMATTED or UNFORMATTED, both of these are explained later. If this specifier is not present then the FORM will default to FORMATTED. file status : A string that holds the status of the file that we would like to open. Note : the default option is compiler dependent so it is recommended that you always specify one of these. We will consider three options;

2 NEW : This indicates that the file should not yet exist and if it does exist the OPEN statement will fail. If it does not exist then the OPEN statement will create it. OLD : This indicates that the file should already exist and if it does not exist the OPEN statement will fail. REPLACE : If the file already exists then it is deleted and a new file created with the same name. If the file does not exist then a new file is created. allowed actions : If deemed necessary it is possible to specify the input/output actions that are permitted to act on the file. If no ACTION specifier is present then the effect is determined by the particular Fortran implementation you are using. Generally, for most implementations, the file will be opened with READWRITE as the default but as this is not guaranteed is is recommended that you always specify an action. Example: READ : This states that the file is to be opened with read-only permissions. If you try to write to the file then an appropriate error message will be generated. WRITE : This states that the file is to be opened with write-only permissions. If you try to read information from the file then an appropriate error message will be generated. READWRITE : This states that the file is to be opened with both read and write permissions. OPEN(UNIT=1,FILE="mat.txt",FORM="FORMATTED",STATUS="OLD",ACTION="READ") This will OPEN the file mat.txt and assign it to UNIT one. The file should already exist ( STATUS="OLD" ). It will be a text file ( FORM="FORMATTED" ) and is being opened with read permission only ( ACTION="READ" ). 2 The CLOSE statement When a program has finished inputting and/or outputting from or to a file then it is prudent to close that file. This is done using the CLOSE statement. CLOSE(UNIT=unit number ) 3 The INQUIRE Statement The INQUIRE statement has many uses in Fortran, we will look at only one. In general the INQUIRE statement can be used to investigate the various details of files. We will learn only how to use the INQUIRE statement to test if a file actually exists. This is very useful, imagine if your were prompted to type in the name of a file by a Fortran code in order to READ some data in from the file. If you typed in the wrong name and tried to OPEN the file then the code would crash. If however you put the READ filename process in a loop along with an INQUIRE statement to test if the file actually exists before exiting the loop, you could allow for such a typing error. Consider the following where file name is a Fortran character string holding a file name and exist file is a variable of type LOGICAL. INQUIRE(File=file name, Exist=exist file) The above statement would check to see if the file file name existed. If file name does exist then the LOGICAL variable exist file will be set to.true. else it will be set to.false. So if the above statement was included in a loop with the READ statement to receive a filename the variable exist file could be used as a test to exit the loop. If exist file was.false. then an appropriate error message should be printed to the screen and another file name requested.

3 4 Formatted Files (text files) Formatted files are simply text files that we can look at in an editor like pico, there is nothing unusual about them, in fact the Fortran 90 codes that you write are saved as text files. To declare a file as being formatted, the FORM specifier is set to be the string "FORMATTED" in the OPEN statement. 4.1 Writing text files The WRITE command is used to write data to a file. WRITE(UNIT=<unit number >,FMT=<format string >) <data list > unit number : Set to be the unit number of the opened file. format string : You can specify a string of formatting characters that describe how the data is to be written to the file or use the default FMT=*. ie WRITE(UNIT=14, FMT="(3(F10.7,1x))") a,b,c WRITE(UNIT=14, FMT=*) a,b,c The first example would write three real numbers that occupy ten columns and have seven decimal places with one blank space separating the numbers. The second example uses the default Fortran format that is specified with FMT=*. data list : The data that is to be written. 4.2 Reading in text files The READ command is used to read in data from a file. READ(UNIT=<unit number >,FMT=<format string >) <data list > unit number : Set to be the unit number of the opened file. format string : You can specify a string of formatting characters that describe how the data is arranged in the file or use the default FMT=*. ie READ(UNIT=14, FMT="(3(F10.7,1x))") a,b,c READ(UNIT=14, FMT=*) a,b,c The first example would read in three real numbers that occupy ten columns and have seven decimal places with one blank space separating the numbers. The second example uses the default Fortran format specified with FMT=*. data list : The declared data types that the data is to be read into. The following example code is a function that reads in from a file any real matrix. The arguments to the function are the number of rows m, the number of columns n and a string filename containing the name of the text file that the matrix is stored in. NOTE the text file should be in the same directory as

4 the fortran source code. FUNCTION getmatf(m,n,filename)!**** Function to input a matrix from a text file. The number of rows!**** (m) and the number of columns (n) are input arguments to the!**** function along with the name of the file INTEGER, INTENT(IN) :: m,n!**** Dummy declaration CHARACTER(LEN=*), INTENT(IN) :: filename!**** Dummy declaration REAL, DIMENSION(m,n) :: getmatf INTEGER :: i!**** Local Declaration!***** Open the file passed in as the string "filename" on unit one < put the correct OPEN statement here > DO i=1,m!**** Do for each row < Put the correct READ statement here >!*** Read in row at a time ENDDO CLOSE(UNIT=1)!***** Close the file END FUNCTION getmatf Note that the simplest method of formatting it is to use the default fortran format FMT=*. This means that we do not have to be strict about the number of decimal places or how many blank spaces separate each element from its neighbouring element. Class Project Five (part I) : Copy the above function into your matrix library and fill in the two missing lines. To test the function type in the matrix below into a text file (exactly how you see it below) using pico and read in the matrix using the above function. Print out the matrix using your outmat procedure now write a complimentary SUBROUTINE outmatf(mat,filename) to WRITE a matrix to a text file. Test this by outputting the transpose of the above matrix to a file called mat2.txt and then reading it in again using the getmatf function and the printing it to the screen. 5 Unformatted Files (binary files) Text files are used simply for convenience, this is because being text files they are easy for us to open in an editor or print out to paper. The computer, however, stores data in a much more efficient way. It stores information as raw binary data files. These are far more efficient as they use less disk space and are quicker to READ in and WRITE out. In fortran binary files are written as unformatted files. We use unformatted files in exactly the same way except in the OPEN statement use FORM="UNFORMATTED"

5 instead of FORM="FORMATTED" and there is NO FMT specifier. Class Project Five (Part II) : Write another function called getmatf u and a subroutine called outmatf u to write out and read in matrices using unformatted I/O. Test them with the matrix below NOTE : Give all your unformatted files the dot extension.dat ie files like mat1.dat and mat2.dat and DO NOT try to open them in pico they are binary files not text files so would make no sense at all, but they can mess up your terminal window if you try to look at them. Also, because you are writing UNFORMATTED files and will not be looking at then on screen or paper then you do not need to output them row by row, to the file, so can simply WRITE the whole array.

Chapter 7: Additional Topics

Chapter 7: Additional Topics Chapter 7: Additional Topics In this chapter we ll briefly cover selected advanced topics in fortran programming. All the topics come in handy to add extra functionality to programs, but the feature you

More information

Information technology Programming languages Fortran Enhanced data type facilities

Information technology Programming languages Fortran Enhanced data type facilities ISO/IEC JTC1/SC22/WG5 N1379 Working draft of ISO/IEC TR 15581, second edition Information technology Programming languages Fortran Enhanced data type facilities This page to be supplied by ISO. No changes

More information

Project 2: Bejeweled

Project 2: Bejeweled Project 2: Bejeweled Project Objective: Post: Tuesday March 26, 2013. Due: 11:59PM, Monday April 15, 2013 1. master the process of completing a programming project in UNIX. 2. get familiar with command

More information

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement? 1. Distinguish & and && operators. PART-A Questions 2. How does an enumerated statement differ from a typedef statement? 3. What are the various members of a class? 4. Who can access the protected members

More information

Embedded SQL. Unit 5.1. Dr Gordon Russell, Copyright @ Napier University

Embedded SQL. Unit 5.1. Dr Gordon Russell, Copyright @ Napier University Embedded SQL Unit 5.1 Unit 5.1 - Embedde SQL - V2.0 1 Interactive SQL So far in the module we have considered only the SQL queries which you can type in at the SQL prompt. We refer to this as interactive

More information

SPSS for Windows importing and exporting data

SPSS for Windows importing and exporting data Guide 86 Version 3.0 SPSS for Windows importing and exporting data This document outlines the procedures to follow if you want to transfer data from a Windows application like Word 2002 (Office XP), Excel

More information

MATLAB Tutorial. Chapter 6. Writing and calling functions

MATLAB Tutorial. Chapter 6. Writing and calling functions MATLAB Tutorial Chapter 6. Writing and calling functions In this chapter we discuss how to structure a program with multiple source code files. First, an explanation of how code files work in MATLAB is

More information

AP Computer Science Java Mr. Clausen Program 9A, 9B

AP Computer Science Java Mr. Clausen Program 9A, 9B AP Computer Science Java Mr. Clausen Program 9A, 9B PROGRAM 9A I m_sort_of_searching (20 points now, 60 points when all parts are finished) The purpose of this project is to set up a program that will

More information

Time Clock Import Setup & Use

Time Clock Import Setup & Use Time Clock Import Setup & Use Document # Product Module Category CenterPoint Payroll Processes (How To) This document outlines how to setup and use of the Time Clock Import within CenterPoint Payroll.

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab Social Science Research Lab American University, Washington, D.C. Web. www.american.edu/provost/ctrl/pclabs.cfm Tel. x3862 Email. SSRL@American.edu Course Objective This course provides

More information

3.GETTING STARTED WITH ORACLE8i

3.GETTING STARTED WITH ORACLE8i Oracle For Beginners Page : 1 3.GETTING STARTED WITH ORACLE8i Creating a table Datatypes Displaying table definition using DESCRIBE Inserting rows into a table Selecting rows from a table Editing SQL buffer

More information

Computational Mathematics with Python

Computational Mathematics with Python Boolean Arrays Classes Computational Mathematics with Python Basics Olivier Verdier and Claus Führer 2009-03-24 Olivier Verdier and Claus Führer Computational Mathematics with Python 2009-03-24 1 / 40

More information

Excel & Visual Basic for Applications (VBA)

Excel & Visual Basic for Applications (VBA) Excel & Visual Basic for Applications (VBA) The VBA Programming Environment Recording Macros Working with the Visual Basic Editor (VBE) 1 Why get involved with this programming business? If you can't program,

More information

Sources: On the Web: Slides will be available on:

Sources: On the Web: Slides will be available on: C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

More information

A Fortran 2003 introduction by examples

A Fortran 2003 introduction by examples A Fortran 2003 introduction by examples Gunnar Wollan 2012 1 Introduction The purpose of this book is to give a good insight in the Fortran 2003 programming language.by going through a number of examples

More information

Introduction to Modern Fortran

Introduction to Modern Fortran Introduction to Modern Fortran p. 1/?? Introduction to Modern Fortran Procedures Nick Maclaren Computing Service nmm1@cam.ac.uk, ext. 34761 November 2007 Introduction to Modern Fortran p. 2/?? Sub-Dividing

More information

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

More information

ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6)

ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6) ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6) 1 COMPUTER LANGUAGES In order for a computer to be able to execute a program, the program must first be present

More information

grep, awk and sed three VERY useful command-line utilities Matt Probert, Uni of York grep = global regular expression print

grep, awk and sed three VERY useful command-line utilities Matt Probert, Uni of York grep = global regular expression print grep, awk and sed three VERY useful command-line utilities Matt Probert, Uni of York grep = global regular expression print In the simplest terms, grep (global regular expression print) will search input

More information

2: Entering Data. Open SPSS and follow along as your read this description.

2: Entering Data. Open SPSS and follow along as your read this description. 2: Entering Data Objectives Understand the logic of data files Create data files and enter data Insert cases and variables Merge data files Read data into SPSS from other sources The Logic of Data Files

More information

Computational Mathematics with Python

Computational Mathematics with Python Computational Mathematics with Python Basics Claus Führer, Jan Erik Solem, Olivier Verdier Spring 2010 Claus Führer, Jan Erik Solem, Olivier Verdier Computational Mathematics with Python Spring 2010 1

More information

Computational Mathematics with Python

Computational Mathematics with Python Numerical Analysis, Lund University, 2011 1 Computational Mathematics with Python Chapter 1: Basics Numerical Analysis, Lund University Claus Führer, Jan Erik Solem, Olivier Verdier, Tony Stillfjord Spring

More information

WESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math

WESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math Textbook Correlation WESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math Following Directions Unit FIRST QUARTER AND SECOND QUARTER Logic Unit

More information

Athena Knowledge Base

Athena Knowledge Base Athena Knowledge Base The Athena Visual Studio Knowledge Base contains a number of tips, suggestions and how to s that have been recommended by the users of the software. We will continue to enhance this

More information

How to test and debug an ASP.NET application

How to test and debug an ASP.NET application Chapter 4 How to test and debug an ASP.NET application 113 4 How to test and debug an ASP.NET application If you ve done much programming, you know that testing and debugging are often the most difficult

More information

Introduction to Perl

Introduction to Perl Introduction to Perl March 8, 2011 by Benjamin J. Lynch http://msi.umn.edu/~blynch/tutorial/perl.pdf Outline What Perl Is When Perl Should Be used Basic Syntax Examples and Hands-on Practice More built-in

More information

PYTHON Basics http://hetland.org/writing/instant-hacking.html

PYTHON Basics http://hetland.org/writing/instant-hacking.html CWCS Workshop May 2009 PYTHON Basics http://hetland.org/writing/instant-hacking.html Python is an easy to learn, modern, interpreted, object-oriented programming language. It was designed to be as simple

More information

13 File Output and Input

13 File Output and Input SCIENTIFIC PROGRAMMING -1 13 File Output and Input 13.1 Introduction To make programs really useful we have to be able to input and output data in large machinereadable amounts, in particular we have to

More information

Creating a Simple Macro

Creating a Simple Macro 28 Creating a Simple Macro What Is a Macro?, 28-2 Terminology: three types of macros The Structure of a Simple Macro, 28-2 GMACRO and ENDMACRO, Template, Body of the macro Example of a Simple Macro, 28-4

More information

Creating trouble-free numbering in Microsoft Word

Creating trouble-free numbering in Microsoft Word Creating trouble-free numbering in Microsoft Word This note shows you how to create trouble-free chapter, section and paragraph numbering, as well as bulleted and numbered lists that look the way you want

More information

LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER

LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER OBJECTIVES 1. Learn the basic elements of VHDL that are implemented in Warp. 2. Build a simple application using VHDL and

More information

The Answer to the 14 Most Frequently Asked Modbus Questions

The Answer to the 14 Most Frequently Asked Modbus Questions Modbus Frequently Asked Questions WP-34-REV0-0609-1/7 The Answer to the 14 Most Frequently Asked Modbus Questions Exactly what is Modbus? Modbus is an open serial communications protocol widely used in

More information

Hands-On UNIX Exercise:

Hands-On UNIX Exercise: Hands-On UNIX Exercise: This exercise takes you around some of the features of the shell. Even if you don't need to use them all straight away, it's very useful to be aware of them and to know how to deal

More information

PA2: Word Cloud (100 Points)

PA2: Word Cloud (100 Points) PA2: Word Cloud (100 Points) Due: 11:59pm, Thursday, April 16th Overview You will create a program to read in a text file and output the most frequent and unique words by using an ArrayList. Setup In all

More information

Pseudo code Tutorial and Exercises Teacher s Version

Pseudo code Tutorial and Exercises Teacher s Version Pseudo code Tutorial and Exercises Teacher s Version Pseudo-code is an informal way to express the design of a computer program or an algorithm in 1.45. The aim is to get the idea quickly and also easy

More information

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

Lesson 07: MS ACCESS - Handout. Introduction to database (30 mins) Lesson 07: MS ACCESS - Handout Handout Introduction to database (30 mins) Microsoft Access is a database application. A database is a collection of related information put together in database objects.

More information

In this Chapter you ll learn:

In this Chapter you ll learn: Now go, write it before them in a table, and note it in a book. Isaiah 30:8 To go beyond is as wrong as to fall short. Confucius Begin at the beginning, and go on till you come to the end: then stop. Lewis

More information

Guide to Performance and Tuning: Query Performance and Sampled Selectivity

Guide to Performance and Tuning: Query Performance and Sampled Selectivity Guide to Performance and Tuning: Query Performance and Sampled Selectivity A feature of Oracle Rdb By Claude Proteau Oracle Rdb Relational Technology Group Oracle Corporation 1 Oracle Rdb Journal Sampled

More information

SAS Tips and Tricks. Disclaimer: I am not an expert in SAS. These are just a few tricks I have picked up along the way.

SAS Tips and Tricks. Disclaimer: I am not an expert in SAS. These are just a few tricks I have picked up along the way. SAS Tips and Tricks Disclaimer: I am not an expert in SAS. These are just a few tricks I have picked up along the way. Saving Data Files Note: You can skip this step entirely by reading the data in directly

More information

Lab 1: Introduction to C, ASCII ART and the Linux Command Line Environment

Lab 1: Introduction to C, ASCII ART and the Linux Command Line Environment .i.-' `-. i..' `/ \' _`.,-../ o o \.' ` ( / \ ) \\\ (_.'.'"`.`._) /// \\`._(..: :..)_.'// \`. \.:-:. /.'/ `-i-->..

More information

but never to show their absence Edsger W. Dijkstra

but never to show their absence Edsger W. Dijkstra Fortran 90 Arrays Program testing can be used to show the presence of bugs, but never to show their absence Edsger W. Dijkstra Fall 2009 1 The DIMENSION Attribute: 1/6 A Fortran 90 program uses the DIMENSION

More information

I PUC - Computer Science. Practical s Syllabus. Contents

I PUC - Computer Science. Practical s Syllabus. Contents I PUC - Computer Science Practical s Syllabus Contents Topics 1 Overview Of a Computer 1.1 Introduction 1.2 Functional Components of a computer (Working of each unit) 1.3 Evolution Of Computers 1.4 Generations

More information

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012 Binary numbers The reason humans represent numbers using decimal (the ten digits from 0,1,... 9) is that we have ten fingers. There is no other reason than that. There is nothing special otherwise about

More information

Storing Measurement Data

Storing Measurement Data Storing Measurement Data File I/O records or reads data in a file. A typical file I/O operation involves the following process. 1. Create or open a file. Indicate where an existing file resides or where

More information

LOG MANAGEMENT Update Log Setup Screen Update Log Options Use Update Log to track edits, adds and deletes Accept List Cancel

LOG MANAGEMENT Update Log Setup Screen Update Log Options Use Update Log to track edits, adds and deletes Accept List Cancel Log Management - Page 22-1 LOG MANAGEMENT There are various log options throughout ZonePro. A log file is a file that store information about changes that have been made while using ZonePro. Log files

More information

NUMBER SYSTEMS. William Stallings

NUMBER SYSTEMS. William Stallings NUMBER SYSTEMS William Stallings The Decimal System... The Binary System...3 Converting between Binary and Decimal...3 Integers...4 Fractions...5 Hexadecimal Notation...6 This document available at WilliamStallings.com/StudentSupport.html

More information

Symbol Tables. Introduction

Symbol Tables. Introduction Symbol Tables Introduction A compiler needs to collect and use information about the names appearing in the source program. This information is entered into a data structure called a symbol table. The

More information

Hands-on Exercise 1: VBA Coding Basics

Hands-on Exercise 1: VBA Coding Basics Hands-on Exercise 1: VBA Coding Basics This exercise introduces the basics of coding in Access VBA. The concepts you will practise in this exercise are essential for successfully completing subsequent

More information

C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 3: Input/Output

C++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 3: Input/Output C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 3: Input/Output Objectives In this chapter, you will: Learn what a stream is and examine input and output streams Explore

More information

Lecture 4: Writing shell scripts

Lecture 4: Writing shell scripts Handout 5 06/03/03 1 Your rst shell script Lecture 4: Writing shell scripts Shell scripts are nothing other than les that contain shell commands that are run when you type the le at the command line. That

More information

State of Michigan Data Exchange Gateway. Web-Interface Users Guide 12-07-2009

State of Michigan Data Exchange Gateway. Web-Interface Users Guide 12-07-2009 State of Michigan Data Exchange Gateway Web-Interface Users Guide 12-07-2009 Page 1 of 21 Revision History: Revision # Date Author Change: 1 8-14-2009 Mattingly Original Release 1.1 8-31-2009 MM Pgs 4,

More information

Introduction to Minitab Macros. Types of Minitab Macros. Objectives. Local Macros. Global Macros

Introduction to Minitab Macros. Types of Minitab Macros. Objectives. Local Macros. Global Macros Minitab Macros 10.1 Introduction to Minitab Macros 10.2 Global Minitab Macros 10.3 Local Minitab Macros 10.4 Advanced Minitab Macro Programming 10.5 Hints on Debugging Macros Introduction to Minitab Macros

More information

HSL and its out-of-core solver

HSL and its out-of-core solver HSL and its out-of-core solver Jennifer A. Scott j.a.scott@rl.ac.uk Prague November 2006 p. 1/37 Sparse systems Problem: we wish to solve where A is Ax = b LARGE Informal definition: A is sparse if many

More information

VB.NET Programming Fundamentals

VB.NET Programming Fundamentals Chapter 3 Objectives Programming Fundamentals In this chapter, you will: Learn about the programming language Write a module definition Use variables and data types Compute with Write decision-making statements

More information

The Program Data Vector As an Aid to DATA step Reasoning Marianne Whitlock, Kennett Square, PA

The Program Data Vector As an Aid to DATA step Reasoning Marianne Whitlock, Kennett Square, PA PAPER IN09_05 The Program Data Vector As an Aid to DATA step Reasoning Marianne Whitlock, Kennett Square, PA ABSTRACT The SAS DATA step is easy enough for beginners to produce results quickly. You can

More information

Using SPSS, Chapter 2: Descriptive Statistics

Using SPSS, Chapter 2: Descriptive Statistics 1 Using SPSS, Chapter 2: Descriptive Statistics Chapters 2.1 & 2.2 Descriptive Statistics 2 Mean, Standard Deviation, Variance, Range, Minimum, Maximum 2 Mean, Median, Mode, Standard Deviation, Variance,

More information

HP-UX Essentials and Shell Programming Course Summary

HP-UX Essentials and Shell Programming Course Summary Contact Us: (616) 875-4060 HP-UX Essentials and Shell Programming Course Summary Length: 5 Days Prerequisite: Basic computer skills Recommendation Statement: Student should be able to use a computer monitor,

More information

Intermediate PowerPoint

Intermediate PowerPoint Intermediate PowerPoint Charts and Templates By: Jim Waddell Last modified: January 2002 Topics to be covered: Creating Charts 2 Creating the chart. 2 Line Charts and Scatter Plots 4 Making a Line Chart.

More information

Unleashing Hidden Powers of Inventor with the API Part 1. Getting Started with Inventor VBA Hello Inventor!

Unleashing Hidden Powers of Inventor with the API Part 1. Getting Started with Inventor VBA Hello Inventor! Unleashing Hidden Powers of Inventor with the API Part 1. Getting Started with Inventor VBA Hello Inventor! Brian Ekins Autodesk, Inc. This article provides an introduction to Inventor's VBA programming

More information

Automatic data recovery

Automatic data recovery Case study: storing data during long measurements? 1 Storing data in NOVA Automatic data recovery In NOVA, all the measured data points are stored in a single.nox file at the end of the measurement. The.nox

More information

EXTENDED FILE SYSTEM FOR F-SERIES PLC

EXTENDED FILE SYSTEM FOR F-SERIES PLC EXTENDED FILE SYSTEM FOR F-SERIES PLC Before you begin, please download a sample I-TRiLOGI program that will be referred to throughout this manual from our website: http://www.tri-plc.com/trilogi/extendedfilesystem.zip

More information

CNC Transfer. Operating Manual

CNC Transfer. Operating Manual Rank Brothers Ltd CNC Transfer Operating Manual Manufactured by: Rank Brothers Ltd 56 High Street, Bottisham, Cambridge CB25 9DA, England Tel: +44 (0)1223 811369 Fax: +44 (0)1223 811441 Website: http://www.rankbrothers.co.uk/

More information

MATLAB Functions. function [Out_1,Out_2,,Out_N] = function_name(in_1,in_2,,in_m)

MATLAB Functions. function [Out_1,Out_2,,Out_N] = function_name(in_1,in_2,,in_m) MATLAB Functions What is a MATLAB function? A MATLAB function is a MATLAB program that performs a sequence of operations specified in a text file (called an m-file because it must be saved with a file

More information

Problem 1. CS 61b Summer 2005 Homework #2 Due July 5th at the beginning of class

Problem 1. CS 61b Summer 2005 Homework #2 Due July 5th at the beginning of class CS 61b Summer 2005 Homework #2 Due July 5th at the beginning of class This homework is to be done individually. You may, of course, ask your fellow classmates for help if you have trouble editing files,

More information

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

KITES TECHNOLOGY COURSE MODULE (C, C++, DS) KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php info@kitestechnology.com technologykites@gmail.com Contact: - 8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL

More information

File by OCR Manual. Updated December 9, 2008

File by OCR Manual. Updated December 9, 2008 File by OCR Manual Updated December 9, 2008 edocfile, Inc. 2709 Willow Oaks Drive Valrico, FL 33594 Phone 813-413-5599 Email sales@edocfile.com www.edocfile.com File by OCR Please note: This program is

More information

Example of a Java program

Example of a Java program Example of a Java program class SomeNumbers static int square (int x) return x*x; public static void main (String[] args) int n=20; if (args.length > 0) // change default n = Integer.parseInt(args[0]);

More information

Unix Shell Scripts. Contents. 1 Introduction. Norman Matloff. July 30, 2008. 1 Introduction 1. 2 Invoking Shell Scripts 2

Unix Shell Scripts. Contents. 1 Introduction. Norman Matloff. July 30, 2008. 1 Introduction 1. 2 Invoking Shell Scripts 2 Unix Shell Scripts Norman Matloff July 30, 2008 Contents 1 Introduction 1 2 Invoking Shell Scripts 2 2.1 Direct Interpretation....................................... 2 2.2 Indirect Interpretation......................................

More information

Paper 70-27 An Introduction to SAS PROC SQL Timothy J Harrington, Venturi Partners Consulting, Waukegan, Illinois

Paper 70-27 An Introduction to SAS PROC SQL Timothy J Harrington, Venturi Partners Consulting, Waukegan, Illinois Paper 70-27 An Introduction to SAS PROC SQL Timothy J Harrington, Venturi Partners Consulting, Waukegan, Illinois Abstract This paper introduces SAS users with at least a basic understanding of SAS data

More information

Build standalone executables from MATLAB code

Build standalone executables from MATLAB code Build standalone executables from MATLAB code P. Legrand ALEA INRIA Team IMB, institut de mathématiques de Bordeaux, UMR CNRS 5251 UFR Sciences et Modélisation 19/06/2012 P. Legrand IMB/ALEA/SCIMS 1/21

More information

PGR Computing Programming Skills

PGR Computing Programming Skills PGR Computing Programming Skills Dr. I. Hawke 2008 1 Introduction The purpose of computing is to do something faster, more efficiently and more reliably than you could as a human do it. One obvious point

More information

An Incomplete C++ Primer. University of Wyoming MA 5310

An Incomplete C++ Primer. University of Wyoming MA 5310 An Incomplete C++ Primer University of Wyoming MA 5310 Professor Craig C. Douglas http://www.mgnet.org/~douglas/classes/na-sc/notes/c++primer.pdf C++ is a legacy programming language, as is other languages

More information

Introduction. What is an Operating System?

Introduction. What is an Operating System? Introduction What is an Operating System? 1 What is an Operating System? 2 Why is an Operating System Needed? 3 How Did They Develop? Historical Approach Affect of Architecture 4 Efficient Utilization

More information

AN INTRODUCTION TO UNIX

AN INTRODUCTION TO UNIX AN INTRODUCTION TO UNIX Paul Johnson School of Mathematics September 24, 2010 OUTLINE 1 SHELL SCRIPTS Shells 2 COMMAND LINE Command Line Input/Output 3 JOBS Processes Job Control 4 NETWORKING Working From

More information

Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)

More information

Moving from C++ to VBA

Moving from C++ to VBA Introduction College of Engineering and Computer Science Mechanical Engineering Department Mechanical Engineering 309 Numerical Analysis of Engineering Systems Fall 2014 Number: 15237 Instructor: Larry

More information

Paper FF-014. Tips for Moving to SAS Enterprise Guide on Unix Patricia Hettinger, Consultant, Oak Brook, IL

Paper FF-014. Tips for Moving to SAS Enterprise Guide on Unix Patricia Hettinger, Consultant, Oak Brook, IL Paper FF-014 Tips for Moving to SAS Enterprise Guide on Unix Patricia Hettinger, Consultant, Oak Brook, IL ABSTRACT Many companies are moving to SAS Enterprise Guide, often with just a Unix server. A surprising

More information

2 SYSTEM DESCRIPTION TECHNIQUES

2 SYSTEM DESCRIPTION TECHNIQUES 2 SYSTEM DESCRIPTION TECHNIQUES 2.1 INTRODUCTION Graphical representation of any process is always better and more meaningful than its representation in words. Moreover, it is very difficult to arrange

More information

2 Matlab Programming, IO, and strings

2 Matlab Programming, IO, and strings 2 Matlab Programming, IO, and strings Programming is the basic skill for implementing numerical methods. In this chapter we describe the fundamental programming constructs used in MATLAB and present examples

More information

Visual Basic 2010 Essentials

Visual Basic 2010 Essentials Visual Basic 2010 Essentials Visual Basic 2010 Essentials First Edition 2010 Payload Media. This ebook is provided for personal use only. Unauthorized use, reproduction and/or distribution strictly prohibited.

More information

ABAQUS/CAE Tutorial: Analysis of an Aluminum Bracket

ABAQUS/CAE Tutorial: Analysis of an Aluminum Bracket H. Kim FEA Tutorial 1 ABAQUS/CAE Tutorial: Analysis of an Aluminum Bracket Hyonny Kim last updated: August 2004 In this tutorial, you ll learn how to: 1. Sketch 2D geometry & define part. 2. Define material

More information

Simulation Tools. Python for MATLAB Users I. Claus Führer. Automn 2009. Claus Führer Simulation Tools Automn 2009 1 / 65

Simulation Tools. Python for MATLAB Users I. Claus Führer. Automn 2009. Claus Führer Simulation Tools Automn 2009 1 / 65 Simulation Tools Python for MATLAB Users I Claus Führer Automn 2009 Claus Führer Simulation Tools Automn 2009 1 / 65 1 Preface 2 Python vs Other Languages 3 Examples and Demo 4 Python Basics Basic Operations

More information

CDD user guide. PsN 4.4.8. Revised 2015-02-23

CDD user guide. PsN 4.4.8. Revised 2015-02-23 CDD user guide PsN 4.4.8 Revised 2015-02-23 1 Introduction The Case Deletions Diagnostics (CDD) algorithm is a tool primarily used to identify influential components of the dataset, usually individuals.

More information

1 Description of The Simpletron

1 Description of The Simpletron Simulating The Simpletron Computer 50 points 1 Description of The Simpletron In this assignment you will write a program to simulate a fictional computer that we will call the Simpletron. As its name implies

More information

Here are some examples of combining elements and the operations used:

Here are some examples of combining elements and the operations used: MATRIX OPERATIONS Summary of article: What is an operation? Addition of two matrices. Multiplication of a Matrix by a scalar. Subtraction of two matrices: two ways to do it. Combinations of Addition, Subtraction,

More information

Introduction to the TI Connect 4.0 software...1. Using TI DeviceExplorer...7. Compatibility with graphing calculators...9

Introduction to the TI Connect 4.0 software...1. Using TI DeviceExplorer...7. Compatibility with graphing calculators...9 Contents Introduction to the TI Connect 4.0 software...1 The TI Connect window... 1 Software tools on the Home screen... 2 Opening and closing the TI Connect software... 4 Using Send To TI Device... 4

More information

Creating a Java application using Perfect Developer and the Java Develo...

Creating a Java application using Perfect Developer and the Java Develo... 1 of 10 15/02/2010 17:41 Creating a Java application using Perfect Developer and the Java Development Kit Introduction Perfect Developer has the facility to execute pre- and post-build steps whenever the

More information

winhex Disk Editor, RAM Editor PRESENTED BY: OMAR ZYADAT and LOAI HATTAR

winhex Disk Editor, RAM Editor PRESENTED BY: OMAR ZYADAT and LOAI HATTAR winhex Disk Editor, RAM Editor PRESENTED BY: OMAR ZYADAT and LOAI HATTAR Supervised by : Dr. Lo'ai Tawalbeh New York Institute of Technology (NYIT)-Jordan X-Ways Software Technology AG is a stock corporation

More information

Embedding SQL in High Level Language Programs

Embedding SQL in High Level Language Programs Embedding SQL in High Level Language Programs Alison Butterill IBM i Product Manager Power Systems Agenda Introduction Basic SQL within a HLL program Processing multiple records Error detection Dynamic

More information

Dynamic Programming. Lecture 11. 11.1 Overview. 11.2 Introduction

Dynamic Programming. Lecture 11. 11.1 Overview. 11.2 Introduction Lecture 11 Dynamic Programming 11.1 Overview Dynamic Programming is a powerful technique that allows one to solve many different types of problems in time O(n 2 ) or O(n 3 ) for which a naive approach

More information

MATLAB Basics MATLAB numbers and numeric formats

MATLAB Basics MATLAB numbers and numeric formats MATLAB Basics MATLAB numbers and numeric formats All numerical variables are stored in MATLAB in double precision floating-point form. (In fact it is possible to force some variables to be of other types

More information

Gentran Integration Suite. Archiving and Purging. Version 4.2

Gentran Integration Suite. Archiving and Purging. Version 4.2 Gentran Integration Suite Archiving and Purging Version 4.2 Copyright 2007 Sterling Commerce, Inc. All rights reserved. Additional copyright information is located on the Gentran Integration Suite Documentation

More information

B) Mean Function: This function returns the arithmetic mean (average) and ignores the missing value. E.G: Var=MEAN (var1, var2, var3 varn);

B) Mean Function: This function returns the arithmetic mean (average) and ignores the missing value. E.G: Var=MEAN (var1, var2, var3 varn); SAS-INTERVIEW QUESTIONS 1. What SAS statements would you code to read an external raw data file to a DATA step? Ans: Infile and Input statements are used to read external raw data file to a Data Step.

More information

Lecture 11 Doubly Linked Lists & Array of Linked Lists. Doubly Linked Lists

Lecture 11 Doubly Linked Lists & Array of Linked Lists. Doubly Linked Lists Lecture 11 Doubly Linked Lists & Array of Linked Lists In this lecture Doubly linked lists Array of Linked Lists Creating an Array of Linked Lists Representing a Sparse Matrix Defining a Node for a Sparse

More information

Linear Algebra and TI 89

Linear Algebra and TI 89 Linear Algebra and TI 89 Abdul Hassen and Jay Schiffman This short manual is a quick guide to the use of TI89 for Linear Algebra. We do this in two sections. In the first section, we will go over the editing

More information

Section of DBMS Selection & Evaluation Questionnaire

Section of DBMS Selection & Evaluation Questionnaire Section of DBMS Selection & Evaluation Questionnaire Whitemarsh Information Systems Corporation 2008 Althea Lane Bowie, Maryland 20716 Tele: 301-249-1142 Email: mmgorman@wiscorp.com Web: www.wiscorp.com

More information

SQL Simple Queries. Chapter 3.1 V3.0. Copyright @ Napier University Dr Gordon Russell

SQL Simple Queries. Chapter 3.1 V3.0. Copyright @ Napier University Dr Gordon Russell SQL Simple Queries Chapter 3.1 V3.0 Copyright @ Napier University Dr Gordon Russell Introduction SQL is the Structured Query Language It is used to interact with the DBMS SQL can Create Schemas in the

More information

Like any function, the UDF can be as simple or as complex as you want. Let's start with an easy one...

Like any function, the UDF can be as simple or as complex as you want. Let's start with an easy one... Building Custom Functions About User Defined Functions Excel provides the user with a large collection of ready-made functions, more than enough to satisfy the average user. Many more can be added by installing

More information

Statements and Control Flow

Statements and Control Flow Contents 1. Introduction 2. Types and Variables 3. Statements and Control Flow 4. Reading Input 5. Classes and Objects 6. Arrays 7. Methods 8. Scope and Lifetime 9. Utility classes 10. Introduction to

More information

Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Systems I: Computer Organization and Architecture Lecture : Microprogrammed Control Microprogramming The control unit is responsible for initiating the sequence of microoperations that comprise instructions.

More information