1 Chapter 1 An Introduction to Structured Program Design in COBOL.

Slides:



Advertisements
Présentations similaires
Les choses que j aime Learning Objective: To know how to use j aime to talk about things I like to do.
Advertisements

THE ADJECTIVES: BEAU, NOUVEAU AND VIEUX 1.
Greetings, formal and informal
Making PowerPoint Slides Avoiding the Pitfalls of Bad Slides.
PERFORMANCE One important issue in networking is the performance of the network—how good is it? We discuss quality of service, an overall measurement.
QUEL CADEAU! YOU HAVE BEEN OF GREAT SERVICE TO FRANCE. PRESIDENT HOLLANDE IS VERY GRATEFUL TO YOU! KNOWING OF YOUR INTEREST IN EGYPTOLOGY, THE DIRECTOR.
1 Case Study 1: UNIX and LINUX Chapter History of unix 10.2 Overview of unix 10.3 Processes in unix 10.4 Memory management in unix 10.5 Input/output.
An Introduction To Two – Port Networks The University of Tennessee Electrical and Computer Engineering Knoxville, TN wlg.
Traffic Sign Recognition Jacob Carlson Sean St. Onge Advisor: Dr. Thomas L. Stewart.
IP Multicast Text available on
Subject: CMS(Content Management System) Université Alioune DIOP de Bambey UFR Sciences Appliquées et Technologies de l’Information et de la Communication.
TP4
jeudi, le quatorze septembre
Theme Three Speaking Questions
Notes for teacher. You can just use slides 2-5 if you wish. If you want to do the practical activity (slides 6-8) you will need to: print off Slide 6.
Infinitive There are 3 groups of REGULAR verbs in French: verbs ending with -ER = 1st group verbs ending with -IR = 2nd group verbs ending with -RE = 3rd.
LES MODULES PLAN DE DEVELOPPEMENT PERSONNEL LEADERSHIP ART ORATOIRE.
Speaking Exam Preparation
Nous allons…. Many magazines include “Look pages” where designers put together an outfit for their perspective clients based on an occasion or trend. You.
mardi, le douze septembre
IDL_IDL bridge The IDL_IDLBridge object class allows an IDL session to create and control other IDL sessions, each of which runs as a separate process.
L’impératif ( = command forms)
Samples for evaluation from All Charts & Templates Packs for PowerPoint © All-PPT-Templates.comPersonal Use Only – not for distribution. All Rights Reserved.
Reflective verbs or Pronominal verbs
Quantum Computer A New Era of Future Computing Ahmed WAFDI ??????
mardi, le douze septembre
the Periodic Table the Periodic Table 2017/2018 Made by : NEDJAR NASSIMA Made by : NEDJAR NASSIMA MS:HAMZA 1.
Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics.
Français I – Leçon 6A Structures
Theme One Speaking Questions
1. Comment t’appelles-tu?
© 2004 Prentice-Hall, Inc.Chap 4-1 Basic Business Statistics (9 th Edition) Chapter 4 Basic Probability.
F RIENDS AND FRIENDSHIP Project by: POPA BIANCA IONELA.
Setting SMART Objectives Training. ©SHRM Introduction Of all the functions involved in management, planning is the most important. As the old saying.
P&ID SYMBOLS. P&IDs Piping and Instrumentation Diagrams or simply P&IDs are the “schematics” used in the field of instrumentation and control (Automation)
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc. Chap 1-1 Chapter 1 Introduction and Data Collection Basic Business Statistics 10 th Edition.
Essai
High-Availability Linux Services And Newtork Administration Bourbita Mahdi 2016.
C’est quel numéro? Count the numbers with pupils.
Français - couleurs - pays - drapeaux
Le soir Objectifs: Talking about what you do in the evening
La famille ER conjugaison
Qu’est-ce que tu as dans ta trousse?
Pato et Elly font du sport aussi.
Les Couleurs.
Qu’est-ce que tu as dans ta trousse?
Definition Division of labour (or specialisation) takes place when a worker specialises in producing a good or a part of a good.
C’est quel numéro? Count the numbers with pupils.
Roots of a Polynomial: Root of a polynomial is the value of the independent variable at which the polynomial intersects the horizontal axis (the function.
Quebec Provincial Elections
Understanding Constraints in Primavera P6Primavera P6.
1-1 Introduction to ArcGIS Introductions Who are you? Any GIS background? What do you want to get out of the class?
sortir avec mes copains faire les magasins jouer à des vidéo
Question formation In English, you can change a statement into a question by adding a helping verb (auxiliary): does he sing? do we sing? did they sing.
WRITING A PROS AND CONS ESSAY. Instructions 1. Begin your essay by introducing your topic Explaining that you are exploring the advantages and disadvantages.
What’s the weather like?
Aujourd’hui nous allons…
Making PowerPoint Slides Avoiding the Pitfalls of Bad Slides.
POWERPOINT PRESENTATION FOR INTRODUCTION TO THE USE OF SPSS SOFTWARE FOR STATISTICAL ANALISYS BY AMINOU Faozyath UIL/PG2018/1866 JANUARY 2019.
By : HOUSNA hebbaz Computer NetWork. Plane What is Computer Network? Type of Network Protocols Topology.
C021TV-I1-S4.
Dans ma Salle de classe
Avoiding the Pitfalls of Bad Slides Tips to be Covered Outlines Slide Structure Fonts Colour Background Graphs Spelling and Grammar Conclusions Questions.
Les négatifs et l’interrogation
University : Ammar Telidji Laghouat Faculty : Technology Department : Electronics 3rd year Telecommunications Professor : S.Benghouini Student: Tadj Souad.
Les couleurs.
Soutenance de thèse: Okba Taouali 1 02/08/2019 Fathia AZZOUZI, Adam BOURAS, Nizar JEBLI Conceptual specifications of a cooperative inter- machines dialogue.
IMPROVING PF’s M&E APPROACH AND LEARNING STRATEGY Sylvain N’CHO M&E Manager IPA-Cote d’Ivoire.
M’SILA University Information Communication Sciences and technology
Transcription de la présentation:

1 Chapter 1 An Introduction to Structured Program Design in COBOL

2 Computer Program A set of instructions that enables computer to process data Also called software Two types of computer programs –Operating system programs - control overall operations of computer –Applications programs - perform tasks required by users

3 Applications Programs Written by applications programmer May provide quick solution to one-time problem –Displaying average grade for set of exam scores Or may be run on regularly scheduled basis –Program to print student transcripts each semester

4 Program Languages Machine language Only language computer understands All programs executed on computer must be in machine language Machine language programs are difficult to write

5 Program Languages Symbolic language (like COBOL) English-like languages used to write programs Easier than writing programs in machine language Must be translated or compiled into machine language to run on computer

6 Nature of COBOL Business-oriented language Standard language English-like language Relatively easy to understand

7 Standard Versions of COBOL 1960s  wide variations in COBOL compilers  first COBOL standard set by American National Standards Institute (ANSI)  second ANSI standard to make COBOL more efficient, standardized  this ANSI standard incorporated structured programming techniques

8 Program Development Process 1.Determine Program Specifications 2.Design Program Using Program Planning Tools 3.Code and Enter Program 4.Compile Program 5.Test Program 6.Document Program

9 1. Program Specifications Systems analysts, users and programmers develop specifications Specifications include: Description of input and output data Step-by-step processing required to convert input to output

10 2. Design the Program Program planning tools used to map out structure and logic of program Flowcharts use block diagrams to represent logic Pseudocode uses English-like statements Hierarchy charts (a.k.a. structure charts) show relationships among sections of program

11 3. Code and Enter Program Programmer writes and enters program into computer Program written in symbolic language (like COBOL) Called source program

12 Source program in symbolic language Object program in machine language Translated by compiler 4. Compile Source Program Compiler is program that Checks source program for rule violations Translates source program into object program

13 5. Test Program Test or debug program to ensure it contains no errors Check for two types of errors –Compile-Time Errors –Execution Errors

14 6. Document the Program Documentation - formal set of procedures and instructions to specify how to use program Written for –Those working with output –Computer operators who run program –Maintenance programmers who make modifications to program

15 Improving Program Design Two techniques used to develop programs that are easier to understand, test, debug and modify Structured Programming Top-Down Programming

16 Structured Programming Eliminates use of GO TO statements –Allowed skipping to different sections of program without returning to starting point Program logic easier to follow with "GO- TO-less" programming

17 Structured Programming Program divided into paragraphs Main paragraph or module controls logic flow using PERFORM statements Main module "performs" other modules when instructions in that module required Each module can be written and tested independently of others

18 Top-Down Programming Another technique to make programs easier to understand, test, debug and modify Develop program like term paper –Develop outline first –Add details for each of main steps –Add further refinement for more complex steps

19 Top-Down Programming For COBOL program Code main modules or routines first Code intermediate modules next Details deferred to minor modules and coded last

20 Interactive vs. Batch Programs Cobol suited for developing both types of programs Interactive programs Accept input data from keyboard Input data processed immediately Output (results) displayed on screen immediately

21 Interactive vs Batch Programs Batch programs Process large volumes of input at periodic intervals Input data read in from files Output written to files

22 Creating a Report An Input File –Fixed record layout –Data are all “jammed” together –Records are read into the computer’s memory An Output Report –Report layout –Data are spread out for easy reading –“Hardcopy” report is sent to the printer

23 The Input File There are no column headings in the input file. There are no field definitions. The data is “all crammed together” in the file. Your COBOL program must know where on field ends and the next field begins.

24 Acton Jocelyn 223 Connecticut StSan FranciscoCA Anderson Hazel 1247 Main Street Woodside CA Baker Donald 1532 Bancroft RoadBerkeley CA BroadhurstRyan J Route 3 Big Trees CA Campbell J. H Powell StreetEmeryville CA Sample Data File Notice, each row (or record) consists of 64 consecutive bytes. A record is READ into computer memory, for use in your COBOL program.

25 Input File Layout Field Length Data Class Last Name 10 Alphanumeric First Name 8 Alphanumeric Street Address 18 Alphanumeric City 13 Alphanumeric State 2 Alphanumeric Zip 5 Alphanumeric Target Contribution 4 Numeric Actual Contribution 4 Numeric Total Record 64

26 The Output Report How many spaces should there be between columns in a report? Do these spaces appear automatically? No, your COBOL program must define the exact report layout, line by line. Consider the following report layout:

27 Sample Report Layout Acton, Jocelyn 223 Connecticut St San Francisco CA Anderson, Hazel 1247 Main Street Woodside CA Baker, Donald 1532 Bancroft Road Berkeley CA Broadhurst, Ryan J Route 3 Big Trees CA Campbell, J. H Powell Street Emeryville CA 94608

28 A COBOL Program Sample Program (p. 23) Coding Form Typically, your COBOL code will be typed in ALL UPPERCASE LETTERS. Periods are very important to all COBOL programs. You will find many errors that are a result of missing periods.

29 Four Divisions of a COBOL Program IDENTIFICATION DIVISION. PROGRAM-ID. PROG1. ENVIRONMENT DIVISION. define the files used by the program DATA DIVISION. define all the variables PROCEDURE DIVISION. the logic of the program

30 IDENTIFICATION DIVISION. Two required entries –The Division Header –The PROGRAM-ID. Notice the use of periods in this division. These periods are required. Omitting or misplacing periods usually causes problems.

31 ENVIRONMENT DIVISION. This is the link between your COBOL program and the actual computer system on which it is running. All COBOL programs (in this class) will have an INPUT-OUTPUT SECTION. This section contains the FILE-CONTROL paragraph.

32 DATA DIVISION. This division will typically have two sections: –FILE SECTION. –WORKING-STORAGE SECTION. Each file listed in the ENVIRONMENT DIVISION must also be defined in the FILE SECTION of the DATA DIVISION. FD – File Description

33 PROCEDURE DIVISION Set of instructions to be executed by program Organization of instructions planned before coding begins Describes program logic and order in which instructions will be executed

34 Read/Move/Print Sequence Data is READ into computer memory Memory defines the fields of the input file Data is MOVEd to computer memory bytes that define the output report layout The report line is written to the output device (i.e., the screen, the printer or a file).