This is It! It’s been a pleasure! Final Exam – format True / false 5 Multiple choice 5 Short answers10 Data manipulation10 SQL 3 Array’s12 File processing25.

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

3-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emertius)
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)
Chapter 15 Indexed Sequential Files. Disk File Organization File is collection of records Three major ways records stored or organized on disk - Sequential.
© 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5/e Starting Out with C++: Early Objects 5 th Edition Chapter 2 Introduction.
Chapter 2: Introduction to C++.
JavaScript, Third Edition
Structured COBOL Programming, Stern & Stern, 9th Edition
Any Questions!. Agenda Fun with Functions –how to get the system date Condition Names INDARA and SI Iteration Logical Files Positioning the file pointer.
VSAM KSDS and COBOL Department of Computer Science Northern Illinois University August 2005 Some of the illustrations are from VSAM: Access Method Services.
15-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)
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2: Introduction to C++ Starting Out with C++ Early Objects Seventh.
4-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)
12-1 Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout John.
4-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 4. To familiarize you with methods used to 1. Access input and output files 2. Read data from an input file 3. Perform simple move operations.
3-1 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emertius)
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
12- 1 Chapter 12.  Single-Level OCCURS Clauses  Processing Data Stored in Array  Using OCCURS Clause for Table Handling  Use of SEARCH Statement 
History COBOL (Common Business Oriented Language) was one of the earliest high-level programming languages. COBOL was first proposed in 1959 by the Conference.
Pascal Programming Strings, Arithmetic operators and output formatting National Certificate – Unit 4 Carl Smith.
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.
COBOL Cobol is one of the most robust language in the software field, so far Cobol turned 50, in 2009 Cobol has stood the test of time Common Business.
Agenda Reporting Work on Assignment 4! Printing on power systems.
BIS 1753 Introduction to Computer Programming 1. Computer Program A set of instructions that enables a computer to process data Also called software Two.
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.
1 Interactive vs Batch Programs Cobol suited for developing both types of programs Interactive programs Accept input data from keyboard Input data processed.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2-1 Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Printing on power systems Program/ Command Data Report Layout (Printer File) Job Output Queue *FILE Spooled File.
7-1 Chapter 7.  Basic Arithmetic Verbs  Options Available with Arithmetic Verbs  COMPUTE Statement  Signed Numbers in Arithmetic Operations  Intrinsic.
Indexed and Relative File Processing
COBOL (Common Business Oriented Language). 1. Introduction to COBOL History of COBOL Coding rules Program Structure Data names and Identifiers Figurative.
1 The Procedure Division Chapter 4. 2 Main Two Sections File Section –Used to define files and record formats –Field names within records Working Storage.
CPSC3111/CISM3111 COBOL Structured COBOL Programming Text: murach’s structured COBOL Authors: Murach, Prince, Menendez.
More Syntax in COBOL  Moving Data  Selection Statements  System Date  Indicators in Display files.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 2: Introduction to C++
Arithmetic and Edited Pictures. Arithmetic Verb Template  Most COBOL arithmetic verbs conform to the template above. For example; ADD Takings TO CashTotal.
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.
12- 1 Chapter 12.  Single-Level OCCURS Clauses  Processing Data Stored in Array  Using OCCURS Clause for Table Handling  Use of SEARCH Statement 
Any Questions!. Test Coming Up! Agenda Printing with Externally Described Printer Files Arrays.
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 5 – The Procedure Division File handling statements –OPEN statement Initiates processing for a file Input Output Each file opened must have been.
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.
Any Questions!. Agenda Fun with Functions –how to get the system date –How to get the next service date INDARA and SI Condition Names Iteration Logical.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
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.
Midterm Exam Topics (Prof. Chang's section) CMSC 201.
Any Questions! 2 Agenda Moving data Arithmetic Verbs Compute statement.
Chapter 4 PROCEDURE DIVISION. Paragraphs PROCEDURE DIVISION divided into paragraphs Each is independent module or routine Made up of series of instructions.
Any Questions!. Agenda Fun with Functions Externally Described Files Condition Names Iteration Logical Files Random Reads.
Week 2/3 - 2nd Lecture Intro to COBOL Programming Defining Files and Processing Data.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to C++
Random update Please use speaker notes for additional information!
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.
Chapter 9: Data types and data structures OCR Computing for A Level © Hodder Education 2009.
Programming in COBOL.
Any Questions?.
2.1 Parts of a C++ Program.
Chapter 3 The DATA DIVISION.
Agenda Collating sequence / Sorting data
Computing in COBOL: The Arithmetic Verbs and Intrinsic Functions
THE COMPUTE STATEMENT Purpose: performs mathematical calculations
Any Questions?.
Programming in COBOL.
Presentation transcript:

This is It! It’s been a pleasure!

Final Exam – format True / false 5 Multiple choice 5 Short answers10 Data manipulation10 SQL 3 Array’s12 File processing25 Calling programs 5 Total 75 Crib sheetsAllowed 2 sheet 8 ½ * 11, hand written, 2 sided, NO photocopies, handed in with exam

Review

Types of Variables Elementary Items. 01 ws-field pic x(3). 77 ws-field2 pic x(3). 01 ws-test pic 1. Group Items 01 ws-group. 05 ws-grp1 pic 9(3). 05 ws-grp2 pic 9(3) comp-3.

Types of Variables Arrays 01 ws-array. 05 ws-array-entry occurs 9 times. 10 array-a pic x(3). 10 array-bpic x(3).

Conditions 01 ws-indicator-list. 05 IN90 indicator 90 pic no-error value B’0’. 88 has-error value B’1’.

Parts of a COBOL Program Identification Division Environment Division Data Division Procedure Division

Area A Division Names Section Names Paragraph Names

Area B Everything else

Editing Functions FunctionCharacter Printing of a / as a separator/ Printing of Decimal Point in an integer. Suppress Leading Zeros in an integerZ Print a Dollar Sign in front of an integer$ Print a Comma in an integer, Printing of + or – signs+ or - Printing of ‘Debit’ or ‘Credit’ symbolsDB or CR Printing of Spaces as separatorsB or b Printing of Zeros as separators0 Print Leading asterix*

READ Statement READ Employee-File (RECORD) (NEXT RECORD) AT END PERFORM 500-End-Of-File-Routine NOT AT END PERFORM 300-Process-Employee INVALID KEY PERFORM 200-Invalid-Key-Logic NOT INVALID KEY PERFORM 220-Valid-Key-Logic END-READ.

Write Statement WRITE record-name FROM Field-name AFTER ADVANCING 9 LINES/PAGE BEFORE ADVANCING 9 LINES/PAGE INVALID KEY PERFORM 300-Invalid-Key-Rtn NOT INVALID KEY PERFORM 310-Valid-Key-Rtn FORMAT IS record-format name INDICATORS ARE variable-name END-WRITE.

Move Statement MOVE Identifier/Variable or Literal/Constant TO (Indentifier/Variable)s Alphanumeric Move? Numeric Move? Group Item Move? Group Item that contains Packed Decimal Data values?

STRING Statement STRING Variable/Constant DELIMITED BY {Variable/Constant/SIZE) INTO variable END-STRING

UNSTRING Statement UNSTRING Variable DELIMITED BY Variable/Constant/SIZE INTO variable1 variable2 variable3 END-UNSTRING

INSPECT Statement INSPECT variable REPLACING {ALL} {LEADING} var/lit by var/lit {FIRST}

Add Statement ADD variable/constant TO variable ROUNDED ON SIZE ERROR PERFORM ERROR-HANDLING-ROUTINE. ADD variable/constant, variable/constant, … GIVING variable ROUNDED ON SIZE ERROR PERFORM ERROR-HANDLING-ROUTINE. ADD variable/constant TO variable/constant GIVING variable ROUNDED ON SIZE ERROR PERFORM ERROR-HANDLING-ROUTINE.

SUBTRACT Statement SUBTRACT Variable/Constant Variable/Constant... FROM Variable ROUNDED ON SIZE ERROR PERFORM ERROR-HANDLING-ROUTINE. SUBTRACT Variable/Constant Variable/Constant … FROM Variable GIVING Variable ROUNDED ON SIZE ERROR PERFORM ERROR-HANDLING-ROUTINE.

MULTIPLY Statement MULTIPLY variable/constant BY variable ROUNDED ON SIZE ERROR PERFORM ERROR-HANDLING-ROUTINE. MULTIPLY variable/constant BY variable/constant GIVING variable ROUNDED ON SIZE ERROR PERFORM ERROR-HANDLING-ROUTINE.

DIVIDE Statement DIVIDE variable/constant INTO variable REMAINDER variable ROUNDED ON SIZE ERROR PERFORM ERROR-HANDLING-ROUTINE. DIVIDE variable/constant INTO variable/constant GIVING variable REMAINDER variable ROUNDED ON SIZE ERROR PERFORM ERROR-HANDLING-ROUTINE. DIVIDE variable/constant BY variable/constant GIVING variable REMAINDER variable ROUNDED ON SIZE ERROR PERFORM ERROR-HANDLING-ROUTINE.

COMPUTE Statement COMPUTE variable ROUNDED = Arithmetic Statement ON SIZE ERROR PERFORM ERROR-HANDLING-ROUTINE

Initialize Verb INITIALIZE variable1 variable2 variable3 … ALPHABETIC REPLACING ALPHANUMERIC NUMERIC ALPHANUMERIC-EDITED NUMERIC-EDITED BY Variable4 literal-1

Set Verb Used to initialize fields to a Condition- Name. Used to initialize/increment indexes for arrays Used to store contents on an index in a variable

Set Verb 01 ARE-THERE-MORE-RECORDS 88 THERE-ARE-MORE-RECORDS VALUE ‘YES’. 88 END-OF-FILEVALUE ‘NO’. SET END-OF-FILE TO TRUE. SET SUB UP BY 1. SET SUB TO SOME-NUMBER.

START Statement START file-name KEY condition INVALID KEY Perform Invalid-Logic NOT INVALID KEY Perform valid-logic END-START.

REWRITE REWRITE record-name (FROM variable-name) INVALID KEY perform error-rtn NOT INVALID KEY perform continue-rtn END-REWRITE.

DELETE DELETE file-name RECORD INVALID KEY perform error-rtn NOT INVALID KEY perform continue-rtn END-DELETE.

Selection IF Condition THEN Statement(s) ELSE Statement(s) END-IF

Evaluate Statements EVALUATE TRUE WHEN MARKS >= 80 MOVE ‘A’ TO GRADE WHEN MARKS >= 70 AND MARKS < 80 MOVE ‘B’ TO GRADE WHEN MARKS >= 60 AND MARKS < 70 MOVE ‘C’ TO GRADE WHEN MARKS >= 55 AND MARKS < 60 MOVE ‘D’ TO GRADE WHEN OTHER MOVE ‘F’ TO GRADE END-EVALUATE.

Perform Statement PERFORM (paragraph-name) PERFORM paragraph-name UNTIL Condition PERFORM (paragraph-name) THROUGH/THRU (paragraph-name) (integer/variable) TIMES PERFORM (paragraph-name) THROUGH/THRU (paragraph-name) WITH TEST AFTER UNTIL Condition

Select Statement SELECT Cobol-file-name ASSIGN TO DISK/DATABASE/PRINTER/WORKSTATION actual-file-name FILE STATUS IS variable-name ORGANIZATION IS INDEXED ACCESS MODE IS SEQUENTIAL/RANDOM/DYNAMIC/TRANSACTION RECORD KEY is data-element/EXTERNALLY DESCRIBED KEY CONTROL-AREA IS variable-name.

Search Array must have an index. Must set the index to where you want to start the search from (usually 1) SEARCH array-entries AT END WHEN END-Search

Search All Array must have an ascending or descending key and be indexed. No need to set the index before the search SEARCH ALL array-entries AT END WHEN END-SEARCH.

CALL (linkage type is Procedure/Program) ‘program-name’ USING parm1 parm2 END-CALL. CALL (linkage type is Procedure/Program) ‘program-name’ USING BY CONTENT parm1 parm2 END-CALL. CALL Statement

SQL How to embed SQL statements in COBOL programs? Replace Read/Delete COBOL Statements? Replace Read/Rewrite COBOL Statements? Replace Read/Write COBOL Statements? Replace Sequential COBOL Statements? What do you need in the working storage section?

Any Questions?