Submitting Instructions on web site CS 1024 students Read guide

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

2-1 Chapter 2.  Coding Requirements of IDENTIFICATION DIVISION  Sections of ENVIRONMENT DIVISION  Assigning Files to Devices in ENVIRONMENT DIVISION.
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.
Modules, Hierarchy Charts, and Documentation
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.
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)
BY: JOSHUA THOMAS IGNATIUS TOWERS COBOL. Overview What is COBOL History Design Implementations What did it do Program structure Data types Syntax Sample.
The IDENTIFICATION and ENVIRONMENT DIVISIONS Chapter 2.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
Modules, Hierarchy Charts, and Documentation
COBOL for the 21 st Century Stern, Stern, Ley Chapter 1 INTRODUCTION TO STRUCTURED PROGRAM DESIGN IN COBOL.
COBOL for the 21st Century
Structured COBOL Programming, Stern & Stern, 9th edition
4-1 Coding Complete COBOL Programs: The PROCEDURE DIVISION Chapter 4.
12-1 Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout John.
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.
Chapter To familiarize you with  Why COBOL is a popular business-oriented language.  Programming practices and techniques  History of COBOL.
Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout.
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)
History COBOL (Common Business Oriented Language) was one of the earliest high-level programming languages. COBOL was first proposed in 1959 by the Conference.
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.
Programming Examples to Accompany Structure Topic Please use speaker notes for additional information!
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.
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.
CS CS Computing for Business Instructor:David Tucker GTA:Batul Mirza.
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.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout.
More Syntax in COBOL  Moving Data  Selection Statements  System Date  Indicators in Display files.
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.
Structured Programming
Structured COBOL Programming, Stern & Stern, 9th Edition CHAPTER 2 Cobol Language Fundamentals.
1 Chapter 5 – The Procedure Division File handling statements –OPEN statement Initiates processing for a file Input Output Each file opened must have been.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
2-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)
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 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.
COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Analysis of SAMPLE1.CBL Please check speaker notes for additional information!
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.
Week 2/3 - 2nd Lecture Intro to COBOL Programming Defining Files and Processing Data.
Chapter 2: Input, Processing, and Output Starting Out with Programming Logic & Design by Tony Gaddis (with instructor modifications) 1-1.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Structured Programming
Programming in COBOL.
Designing and Debugging Batch and Interactive COBOL Programs
Topics Introduction to File Input and Output
Any Questions?.
Chapter 3 The DATA DIVISION.
An Introduction to Structured Program Design in COBOL
Structured COBOL Programming
Chapter 14 Sorting and Merging.
William, Andrew, Stephanio, Michael
Programming in COBOL-85 For IBM Mainframe System 390
Computing in COBOL: The Arithmetic Verbs and Intrinsic Functions
CHAPTER 17 The Report Writer Module
Using screens and adding two numbers - addda.cbl
Any Questions?.
Topics Introduction to File Input and Output
Programming in COBOL.
Presentation transcript:

Submitting Instructions on web site CS 1024 students Read guide Download the EAGS Client Configuration Tool for Fall 1999 Save as box Save it somewhere Start, run, browse, double click on it Installs quickly Go to C:\TEMP and run CuratorSetup.exe

Now get the java runtime 1.2.2 http://java.sun.com/products//jdk/1.2/jre/download-windows.html US English version One large bundle Click on continue Accept Download from java.sun.com http download Save as, save Start,run,browse, double click… Go through the instructions Now use the submit link Association with data names

Chapter 4 COBOL notation Identification Division Syntax and notational conventions - optional, required,lower & upper case Relevant to the book Identification Division Position in program Purpose and syntax provide identifying info - author,dates division and up to 6 paragraphs PROGRAM-ID & header are required 5 others are optional

Environment Division CONFIGURATION SECTION (Optional Entries) Identifies the computer SOURCE-COMPUTER OBJECT-COMPUTER INPUT-OUTPUT SECTION Associates the files in the program with the files known to the OS FILE-CONTROL SELECT statement ASSIGN clause

Data Division FILE SELECTION LABEL RECORDS statement (optional) FD (File Description) statement Size and type of each field Order in which the fields appear relationship of the fields LABEL RECORDS statement (optional) RECORD CONTAINS (record description) statement (optional) DATA RECORD IS statement (optional) documentation only

Figure 4.7 Development of a COBOL Program (File Section) CREDITS UNION MEMBER INITIALS SCHOLARSHIP STUDENT NAME GPA LAST 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 (a) Program Specifications (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-CREDITS PIC 9(2). 05 STU-UNION-MEMBER PIC X. 05 STU-SCHOLARSHIP PIC 9(4). 05 STU-GPA PIC 9V99.

Data Division PICTURE CLAUSE PICTURE IS, PICTURE, PIC IS, PIC Size Number of characters, positions Type 9 - numeric, 0-9 999 same as 9(3) Assumed decimal point Use of a V, PIC 9V99 can hold 1.23 X - alphanumeric, all characters including numbers as characters XXXXXX same as X(6)

Figure 4.3 Student Exam Record STUDENT-NAME EXAM-SCORES SS-NUM LAST NAME FIRST NAME INIT MATH ENGLISH ALG GEO READ VOC LIT 1 15 16 30 31 32 40 41 45 46 50 51 55 56 60 61 65 ALPHANUMERIC NUMERIC

DATA DIVISION RECORD DESCRIPTION Figure 4.5 Assumed Decimal Point INCOMING RECORD DATA DIVISION RECORD DESCRIPTION VALUES 01 INCOMING-DATA-RECORD. 05 STUDENT-NAME PIC 9V99. 05 STUDENT-NAME PIC 99V9. 05 STUDENT-NAME PIC 9. 05 STUDENT-NAME PIC V999. 9.87 65.4. 3 .210 v v v 9 87|65 4|3 | 210

Data Division Level numbers Describe the relationship between the fields in the record Elementary Item - cannot be further divided Group Item - can be further divided Use 01 to 49 01 denotes a record as a whole 02 -49 used for fields within a record Elementry numbers must have picture clauses groups cannot have picture clauses

Data Division WORKING-STORAGE SECTION defines any data name that does not appear in a file stores results of calculations, flags, switch control, constants Used to define print lines Intermediate data storage Filler - can use as a field name, not referenced anywhere else typically holds spaces or constants

Figure 4.4 Level Numbers and PICTURE Clauses 01 STUDENT-EXAM-RECORD. 05 STUDENT-NAME. 10 LAST-NAME PICTURE IS X(15). 10 FIRST-NAME PICTURE IS X(15). 10 MID-INITIAL PICTURE IS X. 05 SOC-SEC-NUM PICTURE IS 9(9). 05 EXAM-SCORES. 10 MATH. 15 ALGEBRA PICTURE IS 9(5). 15 GEOMETRY PICTURE IS 9(5). 10 ENGLISH. 15 READING PICTURE IS 9(5). 15 VOCABULARY PICTURE IS 9(5). 15 LITERATURE PICTURE IS 9(5). 01 STUDENT-EXAM-RECORD. 04 STUDENT-NAME. 08 LAST-NAME PIC X(15). 08 FIRST-NAME PIC X(15). 08 MID-INITIAL PIC X. 04 SOC-SEC-NUM PIC 9(9). 04 EXAM-SCORES. 08 MATH. 12 ALGEBRA PIC 99999. 12 GEOMETRY PIC 99999.. 08 ENGLISH. 12 READING PIC 99999. 12 VOCABULARY PIC 99999. 12 LITERATURE PIC 99999. (a) Initial Coding (b) Alternative Specification

VALUE clause initializes contents of a field (Literals) Numeric literals , VALUE 3.00 Non-numeric literals, VALUE ‘ENGINEERING’ Figurative constants (zero or space), VALUE SPACES

Figure 4.8 Development of a COBOL Program (Constants and Rates) 1. Calculate tuition due at the rate of $200 per credit. 2. The union fee is $25. 3. Compute the activity fee based on the number of credits taken; $25 for 6 credits or less, $50 for 7 to 12 credits, and $75 for more than 12 credits. 4. Award a scholarship equal to the amount in the incoming record if, and only if, the GPA is greater than 2.5. (a) Excerpt from the Program Specifications WORKING-STORAGE SECTION. 01 CONSTANTS-AND-RATES. 05 PRICE-PER-CREDIT PIC 9(3) VALUE 200. 05 UNION-FEE PIC 9(2) VALUE 25. 05 ACTIVITY-FEES. 10 1ST-ACTIVITY-FEE PIC 99 VALUE 25. 10 1ST-CREDIT-LIMIT PIC 99 VALUE 6. 10 2ND-ACTIVITY-FEE PIC 99 VALUE 50. 10 2ND-CREDIT-LIMIT PIC 99 VALUE 12. 10 3RD-ACTIVITY-FEE PIC 99 VALUE 75. 05 MINIMUM-SCHOLARHSIP-GPA PIC 9V9 VALUE 2.5. (b) COBOL Entries

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

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