Figure 3.4The Building Blocks of Structured Programming A B (a) Sequence BA CONDITION? (b) Selection : ENTRYEXIT A B N (d) Case CONDITION? A (c) Iteration.

Slides:



Advertisements
Similar presentations
DT266/2 Information Systems COBOL Revision. Chapters 1 & 2 Hutty & Spence Divisions of a Cobol Program Identification Division Program-ID. Environment.
Advertisements

DT266/2 COBOL Basics – Declaring Data Basic Operations.
More on Algorithms and Problem Solving
Methodology for Program Development Tuition billing program –Specs –File descriptions –Report layout –Processing requirement $200/cr $25 union dues if.
Chapter 4 The Identification, Environment, and Data Divisions.
Repetition There are three different ways that a set of instructions can be repeated, and each way is determined by where the decision to repeat is.
Programming Logic and Design Seventh Edition
- Kav Shrestha.  Introduction  History  Features  COBOL Usage  Characteristics  Structure of COBOL Programs  COBOL Divisions  Data Items  Variable.
Conditions.. IF Syntax.   Simple Conditions l Relation Conditions l Class Conditions l Sign Conditions   Complex Conditions   Condition Names 
Lesson 5 Packed-Decimal or Computational-3 (COMP-3) MOVE TO WS-AMOUNT ====> 4 bytes instead of 7. Significant storage saving. On the.
Repetition Control Structures
Pseudocode.
Pseudocode.
Advanced Sequential Files 1.. Single Record Type Files  In a file which contains only one record type (the kind we have examined so far) the record structure.
COBOL Basics 1. COBOL coding rules  Almost all COBOL compilers treat a line of COBOL code as if it contained two distinct areas. These are known as;
Introduction to COBOL. COBOL  COBOL is an acronym which stands for Common Business Oriented Language.  The name indicates the target area of COBOL applications.
History COBOL (Common Business Oriented Language) was one of the earliest high-level programming languages. COBOL was first proposed in 1959 by the Conference.
Programming in COBOL-85 For IBM Mainframe System 390 Jyothi Sridhar Kini E&R, Infosys Mail-id: Phone:
Chapter 7 – Editing and Coding Standards Numeric field types –Numeric –Numeric-edited Use these only for the fields you define for printing purposes.
Agenda Reporting Work on Assignment 4! Printing on power systems.
1 Chapter 14 - Sorting System Concepts –Sort key Major Key (Primary) Minor Key (Secondary) –Sort sequence Ascending - Low to high Descending – High to.
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.
UNIT 1 UNIT 1 Stephen S. Linkin Houston Community College System 8/28/ Copywrite © Houston Community College System 2007 Graphics Courtesy of IBM.
Module 4 Constants Copy Statement Perform Verb Part 1.
1 Interactive vs Batch Programs Cobol suited for developing both types of programs Interactive programs Accept input data from keyboard Input data processed.
CS CS Computing for Business Instructor:David Tucker GTA:Batul Mirza.
Printing on power systems Program/ Command Data Report Layout (Printer File) Job Output Queue *FILE Spooled File.
COBOL Basics 2. H E N N E S S Y R M L M F Group Items/Records StudentDetails WORKING-STORAGE SECTION. 01StudentDetailsPIC X(26).
Module 2 Defining Data Revised Defining Data All definitions of data for COBOL takes place in the DATA DIVISION. All data defined are visible to.
1 Chapter – 12 Table Lookups Table Codes –Expanded Values –Types of Codes Numeric Alphabetic Alphanumeric.
CPSC3111/CISM3111 COBOL Structured COBOL Programming Text: murach’s structured COBOL Authors: Murach, Prince, Menendez.
Chapter 2 Pseudocode. Objectives To introduce common words, keywords and meaningful names when writing pseudocode To define the three basic control structures.
Pseudocode. Simple Program Design, Fourth Edition Chapter 2 2 Objectives In this chapter you will be able to: Introduce common words, keywords, and meaningful.
Pseudocode Simple Program Design Third Edition A Step-by-Step Approach 2.
Figure 9.9Duplicate Data Names 01 STUDENT-RECORD. 05 STUDENT-NAMEPIC X(20). 05 SOCIAL-SECURITY-NUMPIC 9(9). 05 STUDENT-ADDRESS. 10 STREETPIC X(15). 10.
More Syntax in COBOL  Moving Data  Selection Statements  System Date  Indicators in Display files.
BACS 287 Programming Logic 2. BACS 287 Sequence Construct The sequence construct is the default execution mode for the CPU. The instructions are executed.
11- 1 Chapter 11.  Avoiding Logic Errors by Validating Input  What to Do If Input Errors Occur  Global Considerations in COBOL  When Data Should Be.
1 Chapter 5 – The Procedure Division File handling statements –OPEN statement Initiates processing for a file Input Output Each file opened must have been.
1 Chapter 13 - Mutlilevel Tables System Concepts –User View of tables one dimension view two dimension view three dimension view.
1 Review for test 2 Chapters 7, 8, 9, 11, What is wrong with the following paragraphs? PARA-A. PARA-B. ADD A TO B MOVE 0 TO X PERFROM PARA-A PERFORM.
Any Questions? Agenda Level 77 Initialize Display & Accept Arithmetic Verbs Compute statement String/Unstring Inspect.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
1.  Introduction  The Benefits of the Report Writer Module ◦ For Detail and Summary Printing ◦ For Control Break Processing ◦ For Printing Headings.
Lecture 101 String Processing Operations on numeric edited fields i.e., view the PIC as a string of characters –Reference modification read/write substrings.
Lecture 21 ENVIRONMENT DIVISION  defines files external to the program and devices.  contains two sections: 1.CONFIGURATION SECTION.  identifies computers.
Any Questions? Week 1 - 2nd Lecture Intro to COBOL Programming Defining Files and Processing Data.
11- 1 Chapter 11.  Avoiding Logic Errors by Validating Input  What to Do If Input Errors Occur  Global Considerations in COBOL  When Data Should Be.
3.1.3 Program Flow control Structured programming – SELECTION in greater detail.
The PERFORM. The PERFORM Verb  Iteration is an important programming construct. We use iteration when we need to repeat the same instructions over and.
Programming Logic and Design Fifth Edition, Comprehensive
Week 2/3 - 2nd Lecture Intro to COBOL Programming Defining Files and Processing Data.
Introduction to Sequential Files. COBOL's forte  COBOL is generally used in situations where the volume of data to be processed is large.  These systems.
16- 1 Chapter 16.  To familiarize you with  COPY statement for copying parts of a program stored in a library  CALL statement for executing called.
Pseudocode. Algorithm A procedure for solving a problem in terms of the actions to be executed and the order in which those actions are to be executed.
LOGICAL CONTROL STRUCTURES (chp. 8)
Submitting Instructions on web site CS 1024 students Read guide
Sequence, Selection, Iteration The IF Statement
Screen I/O ACCEPT DISPLAY Relevant to the Fujitsu Compiler.
CASH & Bank Reconciliation
CHAPTER 2 & 3: Pseudocode and Developing and Algorithm
Any Questions?.
Chapter 3 The DATA DIVISION.
Pseudocode.
An Introduction to Structured Program Design in COBOL
Structured COBOL Programming
Programming in COBOL-85 For IBM Mainframe System 390
CHAPTER 17 The Report Writer Module
Programming Concepts and Database
Any Questions?.
Presentation transcript:

Figure 3.4The Building Blocks of Structured Programming A B (a) Sequence BA CONDITION? (b) Selection : ENTRYEXIT A B N (d) Case CONDITION? A (c) Iteration FALSE TRUE

Figure 3.5 Sufficiency of the Basic Structures CONDITION? A B CONDITION 2 ? C TRUE FALSE

Statement A Statement B IF condition is true Statement A ELSE Statement B ENDIF DO WHILE condition is true Statement A ENDDO DO CASE Case 1 is true Statement A Case 2 is true Statement B... ENDCASE (a) The Sequence Structure (b) The Selection Structure (c) The Iteration Structure (d) The Case Structure Figure 3.7Pseudocode for Building Blocks

Figure 4.3Student Exam Record STUDENT-EXAM-RECORD STUDENT-NAMEEXAM-SCORESSS-NUM LAST NAME FIRST NAME INIT MATHENGLISH ALGGEOREADVOCLIT ALPHANUMERICNUMERIC

Figure 4.4Level Numbers and PICTURE Clauses 01 STUDENT-EXAM-RECORD. 05 STUDENT-NAME. 10 LAST-NAMEPICTURE IS X(15). 10 FIRST-NAMEPICTURE IS X(15). 10 MID-INITIALPICTURE IS X. 05 SOC-SEC-NUMPICTURE IS 9(9). 05 EXAM-SCORES. 10 MATH. 15 ALGEBRAPICTURE IS 9(5). 15 GEOMETRYPICTURE IS 9(5). 10 ENGLISH. 15 READINGPICTURE IS 9(5). 15 VOCABULARYPICTURE IS 9(5). 15 LITERATUREPICTURE IS 9(5). 01 STUDENT-EXAM-RECORD. 04 STUDENT-NAME. 08 LAST-NAMEPIC X(15). 08 FIRST-NAMEPIC X(15). 08 MID-INITIALPIC X. 04 SOC-SEC-NUMPIC 9(9). 04 EXAM-SCORES. 08 MATH. 12 ALGEBRAPIC GEOMETRYPIC ENGLISH. 12 READINGPIC VOCABULARYPIC LITERATUREPIC (a) Initial Coding (b) Alternative Specification

Figure 4.5Assumed Decimal Point INCOMING RECORDDATA DIVISION RECORD DESCRIPTION VALUES v v v 9 87|65 4|3 | INCOMING-DATA-RECORD. 05 STUDENT-NAME PIC 9V STUDENT-NAMEPIC 99V9. 05 STUDENT-NAMEPIC STUDENT-NAMEPIC V

Figure 4.7Development of a COBOL Program (File Section) (b) COBOL Entries FD STUDENT-FILE RECORD CONTAINS 27 CHARACTERS. 01 STUDENT-RECORD. 05 STU-NAME. 10 STU-LAST-NAME PIC X(15). 10 STU-INITIALS PIC XX. 05 STU-CREDITSPIC 9(2). 05 STU-UNION-MEMBER PIC X. 05 STU-SCHOLARSHIP PIC 9(4). 05 STU-GPAPIC 9V99. STUDENT NAME LAST GPA INITIALS CREDITSUNION MEMBER SCHOLARSHIP (a) Program Specifications

Figure 4.9Development of a COBOL Program (Print Lines) (a) Report Layout

Figure 4.9Development of a COBOL Program (Print Lines) (b) COBOL Entries 01 HEADING-LINE. 05 FILLERPIC X VALUE SPACES. 05 FILLERPIC X(12) VALUE ‘STUDENT NAME’. 05 FILLERPIC X(10) VALUE SPACES. 05 FILLERPIC X(7) VALUE ‘CREDITS’. 05 FILLERPIC X(2) VALUE SPACES. 05 FILLERPIC X(7) VALUE ‘TUITION’. 05 FILLERPIC X(2)VALUE SPACES. 05 FILLERPIC X(9)VALUE ‘UNION FEE’. 05 FILLERPIC X(2)VALUE SPACES. 05 FILLERPIC X(7)VALUE ‘ACT FEE’. 05 FILLERPIC X(2)VALUE SPACES. 05 FILLERPIC X(11)VALUE ‘SCHOLARSHIP’. 05 FILLERPIC X(2)VALUE SPACES. 05 FILLERPIC X(10)VALUE ‘TOTAL BILL’. 05 FILLERPIC X(48)VALUE SPACES. 01 DETAIL-LINE. 05 FILLERPIC X VALUE SPACES. 05 DET-LAST-NAMEPIC X(15). 05 FILLERPIC X(2) VALUE SPACES. 05 DET-INITIALSPIC X(2). 05 FILLERPIC X(5) VALUE SPACES. 05 DET-CREDITSPIC 9(2). 05 FILLERPIC X(2)VALUE SPACES. 05 DET-TUITIONPIC 9(6). 05 FILLERPIC X(7)VALUE SPACES. 05 DET-UNION-FEEPIC 9(3). 05 FILLERPIC X(8)VALUE SPACES. 05 DET-SCHOLARSHIPPIC 9(5). 05 FILLERPIC X(6)VALUE SPACES. 05 DET-IND-BILLPIC 9(6). 05 FILLERPIC X(49)VALUE SPACES.