Move and Edited Output1 NON-NUMERIC: Left justify the data in the memory location. If the length of the data is smaller than the length of the field (as.

Slides:



Advertisements
Similar presentations
SCIENTIFIC NOTATION: Abbreviating numbers. What is an EXPONENT?  A SUPERSCRIPT after “x 10” or “E”SUPER  Ex: “x 10 5” or “E5”  Denotes how many powers.
Advertisements

Introduction to Computing Concepts Note Set 7. Overview Variables Data Types Basic Arithmetic Expressions ▫ Arithmetic.
6-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Dale Roberts Basic I/O – printf() CSCI 230 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Department of.
Please turn in your Home-learning, get your notebook and Springboard book, and begin the bell-ringer! Test on Activity 6, 7 and 8 Wednesday (A day) and.
Lecture - 2 Number systems and computer data formats
7-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
1 Chapter 9 - Formatted Input/Output Outline 9.1Introduction 9.2Streams 9.3Formatting Output with printf 9.4Printing Integers 9.5Printing Floating-Point.
The Decimal Number System
Chapter 9 Formatted Input/Output Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 9 - Formatted Input/Output Outline 9.1Introduction.
 2007 Pearson Education, Inc. All rights reserved C Formatted Input/Output.
Whole Numbers and Tables: Writing, Rounding, and Inequalities Section 1.1.
 2007 Pearson Education, Inc. All rights reserved C Formatted Input/Output.
Scientific Notation Recognize and use scientific notation.
Presentation © Copyright 2002, Bryan Meyers Defining Data with Definition Specifications Chapter 3.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Streams Streams –Sequences of characters organized.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 9 - Formatted Input/Output Outline 9.1Introduction.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Chapter 9 Formatted Input/Output. Objectives In this chapter, you will learn: –To understand input and output streams. –To be able to use all print formatting.
A Variable is symbolic name that can be given different values. Variables are stored in particular places in the computer ‘s memory. When a variable is.
Fortran 1- Basics Chapters 1-2 in your Fortran book.
 Pearson Education, Inc. All rights reserved Formatted Output.
 2005 Pearson Education, Inc. All rights reserved Formatted Output.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Modifications to program Addda.cbl Please use speaker notes for additional information!
Chapter 5 Using Data and COBOL Operators. Initializing Variables When you define a variable in WORKING- STORAGE, you also can assign it an initial value.
Five Tips to Success. Work hard Try more exercises and more practice.
Chapter 7 – Editing and Coding Standards Numeric field types –Numeric –Numeric-edited Use these only for the fields you define for printing purposes.
6-1 Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout John.
Agenda Reporting Work on Assignment 4! Printing on power systems.
7-1 Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout John.
Lecture 31 Numeric Edited Alphabetic (A) AlphaNumeric (X) Numeric (9, V, S) Numeric Edited (9, Z, comma, decimal point, minus sign) –Z = zero suppressed.
The DATA DIVISION Chapter 3. COBOL Data Organization Field - group of characters forming a meaningful unit or basic fact –Characters in a name or digits.
3-1 Chapter 3. To familiarize you with  Ways in which data is organized in COBOL  Rules for forming data-names  Defining input and output files in.
3-1 The DATA DIVISION Chapter Chapter Objectives To familiarize you with Systems design considerations Ways in which data is organized Rules for.
7-1 Chapter 7.  Basic Arithmetic Verbs  Options Available with Arithmetic Verbs  COMPUTE Statement  Signed Numbers in Arithmetic Operations  Intrinsic.
Algebra Standard 1.0 Recognize and Use Scientific Notation.
To familiarize you with  Options of MOVE statement  Rules for moving fields and literals  Printing edit symbols  Designing and printing reports 1.
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
More Syntax in COBOL  Moving Data  Selection Statements  System Date  Indicators in Display files.
Arithmetic and Edited Pictures. Arithmetic Verb Template  Most COBOL arithmetic verbs conform to the template above. For example; ADD Takings TO CashTotal.
Lecture 61 Editted Output Editing Functions –Two broad classes : A) insertion and B) replacement and suppression 1.Printing decimal points 2.Suppressing.
INPUT / OUTPUT STATEMENTS
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
What is C? C is a programming language. It was developed in 1972 USA. It was designed and written by a man named dennis ritchie. C is the base for all.
Significant Figure Rules. Rule Number 1 All non zero digits are significant. Examples 1179 – 4 significant figures significant figures
7-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Primitive Variables.
CONSTANTS Constants are also known as literals in C. Constants are quantities whose values do not change during program execution. There are two types.
Chapter 3 – Variables and Arithmetic Operations. Variable Rules u Must declare all variable names –List name and type u Keep length to 31 characters –Older.
Data Structure and c K.S.Prabhu Lecturer All Deaf Educational Technology.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
Integrated Mathematics Compare & Order Real Numbers.
Variables in C Topics  Naming Variables  Declaring Variables  Using Variables  The Assignment Statement Reading  Sections
Objective: Students will change units within the metric system (4-9).
+ Note On the Use of Different Data Types Use the data type that conserves memory and still accomplishes the desired purpose. For example, depending on.
6-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
BASIC ELEMENTS OF A COMPUTER PROGRAM
TMF1414 Introduction to Programming
Significant Digits & Rounding
Variables In programming, we often need to have places to store data. These receptacles are called variables. They are called that because they can change.
Chapter 3 The DATA DIVISION.
Scientific Notation.
Computing in COBOL: The Arithmetic Verbs and Intrinsic Functions
THE COMPUTE STATEMENT Purpose: performs mathematical calculations
Conversion Check your class notes and given examples at class.
Any Questions?.
Decimals LI: To identify the information that a decimal number shows and to be able to round a decimal. LI: To be able to round to the nearest 100, 10.
Decision Making Using the IF and EVALUATE Statements
Presentation transcript:

Move and Edited Output1 NON-NUMERIC: Left justify the data in the memory location. If the length of the data is smaller than the length of the field (as defined by the pic clause), fill to the right with blanks. If the length of the data is larger than the length of the field (as defined by the pic clause), truncate the data that does not fit into the memory location. NUMERIC integer portion: Right justify the data in the integer portion of the memory location. If the length of the data is smaller than the length of the integer portion of the field (as defined by the pic clause), then fill to the left with zeros. If the length of the data is larger than the length of the integer portion of the field (as defined by the pic clause), then truncate the data to the left that does not fit into the memory location. NUMERIC decimal portion: Left justify the data into the decimal portion of the memory location. If the length of the data is smaller than the length of the decimal portion of the field (as defined by the pic clause), then fill to the right with zeros. If the length of the data is larger than the length of the decimal portion of the field (as defined by the pic clause), then truncate the data to the right that does not fit into the memory location. SIGN: The S character in a PIC clause denotes that the data for that memory location can be a positive or negative value. The sign, however, does not take up a position in memory! FYI: Remember that truncation is used… not rounding! The MOVE Statement Rules for Receiving Field

Move and Edited Output2 Numeric LiteralB PIC MEMORY LOCATIONS FOR B (6)_________________________ (5)_________________________ (8)_________________________ (5)_________________________ (4)V99 _________________________ (6)V9(3)_________________________ (6)V9_________________________ (3)V9_________________________ 12345S9(6)_________________________ S9(6)_________________________ (6)_________________________ MOVE numeric-literal TO B. Fill in every memory location for B… use a b (lower case letter b) to denote a blank THE MOVE STATEMENT cont

Move and Edited Output3 Non-Numeric Literal B PIC MEMORY LOCATIONS FOR B kitty A(10)_________________________ kitty X(8)_________________________ 10 caps A(10)_________________________ 10 caps X(5)_________________________ MOVE non-numeric-literal TO B. Fill in every memory location for B… use a b (lower case letter b) to denote a blank THE MOVE STATEMENT cont

Move and Edited Output4 Legal and Illegal MOVEs Type of MoveLegal? Alphabetic to alphabeticYes Alphabetic to alphanumericYes Alphabetic to alphanumeric editedYes Alphanumeric to alphanumericYes Alphanumeric to alphanumeric editedYes Alphanumeric to alphabeticOnly if sending field is alphabetic Alphanumeric to numericOnly if sending field is an unsigned integer Alphanumeric to numeric editedOnly if sending field is an unsigned integer Numeric to numericYes Numeric to numeric editedYes Numeric to alphanumericOnly if sending field is an unsigned integer Numeric to alphanumeric editOnly if sending field is an unsigned integer Numeric edited to numericYes, to de-edit a field Alphanumeric edited to alphanumericYes, but does not de-edit a field

Move and Edited Output5 Edited Output Characters REMEMBER… each character holds a place in memory EX. $9, Insertion characters (alphnumeric editing)  B and / can be used in the picture clause and that positions takes on a blank space or the / character 2. Insertion characters (numeric editing)  same as above using B / and 0 3. Zero suppression  (numeric editing) the letter Z denotes a blank if position is zero 4. Sign control  plus and minus sign to the right of the field; + denotes that you want the sign to show; - denotes that you only want the sign to show up if the value is negative… still holds a place in memory, but is blank 5. Fixed dollar sign  $ always shows up in the placed position 6. Floating dollar sign  $ shows up to the left of the most significant digit; non- significant positions are filled in with blanks (including commas!) 7. Check protection  asterisks (*) show up to the left of the most significant digit 8. Floating plus sign  + (see floating $ and sign control) 9. Floating minus sign  - (see floating $ and sign control 10. Other  comma and decimal point

Move and Edited Output6 Value of Picture of Sending FieldReceiving FieldEdit Result XXXBXXBXXXX392b38b XX/XX/XXXX03/21/ B99B b38b /99/999903/21/ ,000125, ZZZ ZZZ.99bb Z,ZZZ.991, Z,ZZZ.99bbb Z,ZZZ.99bbbbb ZZZ,ZZZ-bb1,234b -1234ZZZ,ZZZ-bb1, ZZZ,ZZZ+bb1, ZZZ,ZZZ+bb1,234- Edited Output Examples REMINDER: the length of the “picture of receiving field” will always be the same length as the “edit result”

Move and Edited Output7 Value of Picture of Sending FieldReceiving FieldEdit Result 1234$ZZZ,ZZZ$bb1, $ZZZZ.99$ $ZZZZ.99$ $$,$$$.99$1, $$,$$$.999bbb$ $*,***.99$1, $*,***.99$*** **,***.99*1, , , , , ,+++.99bbb ,+++.99bbb , , , , ,---.99bbbb ,---.99bbb Edited Output Examples cont REMINDER: the length of the “picture of receiving field” will always be the same length as the “edit result”