PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.

Slides:



Advertisements
Similar presentations
Structured COBOL Programming
Advertisements

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)
12-1 Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout John.
8-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)
16-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)
2-1 Chapter 2.  Coding Requirements of IDENTIFICATION DIVISION  Sections of ENVIRONMENT DIVISION  Assigning Files to Devices in ENVIRONMENT DIVISION.
The Future of COBOL A Focus on Interactive Programming Appendix C Stern & Stern.
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)
Chapter 15 Creating Database Forms and Reports Introduction Forms Reports.
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)
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
The IDENTIFICATION and ENVIRONMENT DIVISIONS Chapter 2.
5-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)
14-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)
COBOL for the 21 st Century Stern, Stern, Ley Chapter 1 INTRODUCTION TO STRUCTURED PROGRAM DESIGN IN COBOL.
COBOL for the 21st Century
Accounting Information Systems, 1st Edition
Structured COBOL Programming
Introduction to Databases
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
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)
PowerPoint Presentation for Dennis, Wixom, & Roth Systems Analysis and Design, 3rd Edition Copyright 2006 © John Wiley & Sons, Inc. All rights reserved..
Structured COBOL Programming, Stern & Stern, 9th Edition PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
Structured COBOL Programming, Stern & Stern, 9th edition
4-1 Coding Complete COBOL Programs: The PROCEDURE DIVISION Chapter 4.
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.
12-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)
10-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)
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)
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)
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.
1-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)
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)
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
Chapter 4: Organizing and Manipulating the Data in Databases
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.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
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.
13-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)
9-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)
Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout.
Slide 1-1 Chapter 1 Terms Information Systems Overview Introduction to Information Systems Judith C. Simon.
Slide 5-1 Chapter 5 Terms Applications Software for Business Introduction to Information Systems Judith C. Simon.
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.
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)
Structured COBOL Programming, Stern & Stern, 9th Edition CHAPTER 2 Cobol Language Fundamentals.
13-1 Sequential File Processing Chapter Chapter Contents Overview of Sequential File Processing Sequential File Updating - Creating a New Master.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
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)
1.  Introduction  The Benefits of the Report Writer Module ◦ For Detail and Summary Printing ◦ For Control Break Processing ◦ For Printing Headings.
PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
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 COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Slide 8-1 Chapter 8 Terms Programming Languages Introduction to Information Systems Judith C. Simon.
Slide 6-1 Chapter 6 Terms System Software Considerations Introduction to Information Systems Judith C. Simon.
Designing and Debugging Batch and Interactive COBOL Programs
Chapter 3 The DATA DIVISION.
An Introduction to Structured Program Design in COBOL
Structured COBOL Programming
CHAPTER 17 The Report Writer Module
Presentation transcript:

PowerPoint Presentation: Richard H. Baum, Ph.D. DeVry Institute of Technology 9th Edition Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College 2000 John Wiley & Sons, In. All rights reserved. Reproduction or translation of this work beyond that permitted in Section 117 of the 1976 United States Copyright Act without the express permission of the copyright owner is unlawful. Request for further information should be addressed to the permissions Department, John Wily & Sons, Inc. The purchaser may make back-up copies for his/her own use only and not for distribution or resale. The Publisher assumes no responsibility for errors, omissions, or damages, caused by the use of these programs or from the use of the information contained herein.”

Structured COBOL Programming, Stern & Stern, 9th Edition Chapter 3 The Data Division: File Section and Working-Storage Section

Structured COBOL Programming, Stern & Stern, 9th Edition OBJECTIVES To familiarize you with: 1. Systems design considerations that relate to programming. 2. The ways in which data is organized. 3. The rules for forming data-names and constants in COBOL. 4. How input and output files are defined and described in the DATA DIVISION. 5. How storage can be reserved for fields not part of input or output, such as constants and work areas.

Structured COBOL Programming, Stern & Stern, 9th Edition CONTENTS SYSTEMS DESIGN CONSIDERATIONS –The Relationship between a Business Information System and its Programs –Interactive and Batch Processing –Designing Input for Applications Using Batch Processing

Structured COBOL Programming, Stern & Stern, 9th Edition CONTENTS FORMING DATA-NAMES –Rules –Guidelines THE FILE SECTION OF THE DATA DIVISION –An Overview –File Description Entries –Record Description Entries

Structured COBOL Programming, Stern & Stern, 9th Edition CONTENTS TYPES OF DATA –Variable and Constant Data –Types of Constants THE WORKING-STORAGE SECTION OF THE DATA DIVISION –Introduction –Uses of WORKING-STORAGE –VALUE Clauses for WORKING-STORAGE Entries

Structured COBOL Programming, Stern & Stern, 9th Edition THE FILE SECTION OF THE DATA DIVISION

Structured COBOL Programming, Stern & Stern, 9th Edition AN OVERVIEW The DATA DIVISION is that part of a COBOL program that defines and describes fields, records, and files in storage. –Any area of storage that is required for the processing of data must be established in the DATA DIVISION.

Structured COBOL Programming, Stern & Stern, 9th Edition AN OVERVIEW THE TWO MAIN SECTIONS OF THE DATA DIVISION 1. FILE SECTION -- defines all input and output files. 2. WORKING-STORAGE SECTION - reserves storage for fields that are not part of input or output but are required for processing. – These include constants, end-of- file indicators, and work areas.

Structured COBOL Programming, Stern & Stern, 9th Edition INTERACTIVE PROCESSING Interactive programs that just accept input from a keyboard and display output on a screen do not need SELECT statements or a FILE SECTION.

Structured COBOL Programming, Stern & Stern, 9th Edition File Description Entries AN OVERVIEW Defining a File The FILE SECTION, as the name implies, describes all input and output files used in the program in the FILE SECTION of the DATA DIVISION.

Structured COBOL Programming, Stern & Stern, 9th Edition File Description Entries AN OVERVIEW Defining a File  The FILE SECTION describes the input and output areas used in the program.  A READ instruction, in the PROCEDURE DIVISION, will transmit one record of the designated file to this input area.  Similarly, an output area is primary storage reserved for a record to be produced in an output file.

Structured COBOL Programming, Stern & Stern, 9th Edition File Description Entries Each file is described in the FILE SECTION with an FD sentence that may consist of a series of clauses. After the clauses are specified, the FD sentence ends with a period. FD is an abbreviation for File Description.

Structured COBOL Programming, Stern & Stern, 9th Edition FILE DESCRIPTION ENTRIES An example: SELECT INVENTORY-FILE ASSIGN TO DISK1. SELECT ERROR-LIST ASSIGN TO PRINTER. * DATA DIVISION. FILE SECTION. FDINVENTORY-FILE.. FDERROR-LIST

Structured COBOL Programming, Stern & Stern, 9th Edition LABEL RECORD(S) Clause FORMAT: LABEL {RECORD IS}{RECORDS ARE} {OMITTED}{STANDARD} Interpreting Instruction Formats –Each set of braces {} denotes that one of the enclosed items is required.

Structured COBOL Programming, Stern & Stern, 9th Edition LABEL RECORD(S) Clause Label records are usually created as the first and last records of a disk file – They provide identifying information about the file. – They can be used to check if the correct file is being accessed for a specific program.

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD CONTAINS Clause -- (Optional) Format: RECORD CONTAINS integer-1 CHARACTERS The RECORD CONTAINS clause indicates the size of each record. – A print file, for example, may have the following entry: RECORD CONTAINS 80 CHARACTERS.

Structured COBOL Programming, Stern & Stern, 9th Edition BLOCK CONTAINS Clause - (Optional) Format BLOCK CONTAINS integer-1 RECORDS The BLOCK CONTAINS clause is included in the File Description entry only for files on magnetic media –A group of logical records is included within one block to maximize the efficient use of a disk area.

Structured COBOL Programming, Stern & Stern, 9th Edition QUESTIONS??!!

Structured COBOL Programming, Stern & Stern, 9th Edition SELF-TEST 1. What is the purpose of the DATA DIVISION? SOLUTION--It describes and defines fields, records, and files in storage.

Structured COBOL Programming, Stern & Stern, 9th Edition SELF-TEST 2. What are the two primary sections of a DATA DIVISION? SOLUTION-----FILE SECTION; WORKING-STORAGE SECTION

Structured COBOL Programming, Stern & Stern, 9th Edition SELF-TEST 3. What is the purpose of the FILE SECTION of the DATA DIVISION? SOLUTION: It defines and describes all data areas that are part of input or output.

Structured COBOL Programming, Stern & Stern, 9th Edition SELF-TEST 4. File-names must be from one to ______ characters in length, contain at least one ______, and have no _______. SOLUTION: 30; alphabetic character; special characters or blanks.

Structured COBOL Programming, Stern & Stern, 9th Edition SELF-TEST 5. File-names (must, need not) be unique. SOLUTION: must

Structured COBOL Programming, Stern & Stern, 9th Edition SELF-TEST 6. For every file defined in a SELECT statement, there will be one _______ entry in the FILE SECTION. SOLUTION: FD

Structured COBOL Programming, Stern & Stern, 9th Edition SELF-TEST 7. The three clauses that may be used with an FD are _______, _________, and ___________. SOLUTION: LABEL RECORD; RECORD CONTAINS; BLOCK CONTAINS

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES Defining a Record A record is a unit of information consisting of related data items within a file. –A file consists of records that all have the same length and format called fixed-length records.

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES Level Numbers –After a file is described by an FD, the record description entries for each record format within the file follow. The record description specifies the format of a record. –Just as the file-name is specified on the FD level, a record- name is coded on the 01 level.

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES Level Numbers--Example 1 –A transaction disk file with only one record format may have the following entries: FDTRANSACTION-FILE LABEL RECORDS ARE OMITTED RECORD CONTAINS 80 CHARACTERS. 01TRANSACTION-REC-IN...{Entries of the record}

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES Level Numbers Data is grouped in COBOL using the concept of a level. Records are considered the highest level of data in a file, and are coded on the 01 level. – A record consists of fields.

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES Level Numbers The record description entries following the FD are: 01 EMPLOYEE-REC-IN. 05 NAME-IN 05 ANNUAL-SALARY-IN 05 JOB-DESCRIPTION-IN All fields on the 05 level are subordinate to, or part of, the 01- level entry. All fields coded on the same level are independent items.

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES Fields May Be Defined as Either Elementary or Group Items A field that is not further subdivided is called an elementary item. A field that is further subdivided is called a group item.

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES Fields May Be Defined as Either Elementary or Group Items All elementary items must be additionally described with a PICTURE clause that indicates the size and type of the field. A group item, because it is subdivided, needs no further specification and ends with a period.

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES PICTURE (PIC) Clauses Group items are defined by a level number and a name, which is followed by a period. Elementary items or fields not further subdivided must be described with a PICTURE (or PIC, for short) clause.

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES FUNCTIONS OF THE PICTURE CLAUSE 1. To specify the type of data contained within an elementary item. 2. To indicate the size of the field.

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES TYPES OF DATA FIELDS 1. Alphabetic –A field that may contain only letters or blanks is classified as alphabetic. 2. Alphanumeric –A field that may contain any character is considered alphanumeric. 3. Numeric –Any signed or unsigned field that will contain only digits is considered numeric.

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES CHARACTERS USED IN PICTURE CLAUSES A for alphabetic X for alphanumeric 9 for numeric

Structured COBOL Programming, Stern & Stern, 9th Edition DEBUGGING TIP Data entered into a field should be consistent with the data type specified in the PIC clause to ensure that errors do not occur. If you define a field with a PIC of 9’s it must contain numeric characters to be processed correctly. Use a PIC of 9’s only for fields used in arithmetic operations. *NOTE: a space is not a valid character in a numeric field.

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES Size of Data Fields The size of the field is denoted by the number of A's, X's, or 9's used in the PICTURE. Example: 01 CUST-REC-IN. 05 CUST-ID-IN PICTURE XXXX. (4 positions) 05 AMT-IN PICTURE (5 positions)

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES Size of Data Fields Group items are those fields that are further subdivided – They do not have PICTURE clauses. Elementary items require a PICTURE clause – The clause denotes the size of a field and the type of data.

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES Example of an Output Record: 01 CREDIT-CARD-ACCT-OUT. 05 NAME-OUT. 10 INIT1-OUT PICTURE X. 10 INIT2-OUT PICTURE X. 10 LAST-NAME-OUT PICTURE X(18). 05 CREDIT-CARD-NO-OUT PICTURE X(5). 05 ADDRESS-OUT PICTURE X(20). 05 AMT-OF-TRANS-OUT PICTURE 9(5).

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES THE USE OF THE IMPLIED DECIMAL POINT In order for a five-position input amount field: 10000, to be interpreted as , we want the computer to “assume” that a decimal point exists. –Its PICTURE clause, then, is: 05 AMT-IN PICTURE 999V99. The symbol V denotes an implied decimal point, which does not occupy a storage position.

Structured COBOL Programming, Stern & Stern, 9th Edition RECORD DESCRIPTION ENTRIES: SUMMARY An 01-level entry and its corresponding field description must be included for every record format in a file. All record formats within an FD are described before the next FD is defined. The syntax rules governing the DATA DIVISION indicate the sequence in which entries are coded.

Structured COBOL Programming, Stern & Stern, 9th Edition THE WORKING-STORAGE SECTION OF THE DATA DIVISION

Structured COBOL Programming, Stern & Stern, 9th Edition INTRODUCTION Any field necessary for processing that is not part of an input or output file may be defined in the WORKING-STORAGE SECTION of the DATA DIVISION. 1. The WORKING-STORAGE SECTION follows the FILE SECTION. 2. WORKING-STORAGE SECTION is coded on a line by itself beginning in Area A and ending with a period.

Structured COBOL Programming, Stern & Stern, 9th Edition INTRODUCTION 3. A group item that will be subdivided into individual storage areas as needed may then be defined. All necessary fields can be described within this 01-level entry. 4. Names associated with group and elementary items must conform to the rules for data-names. WS- is frequently used as a prefix to denote fields as WORKING-STORAGE entries. 5. Each elementary item must contain a PIC clause. 6. Each elementary item may contain an initial value, if desired.

Structured COBOL Programming, Stern & Stern, 9th Edition VALUE CLAUSES FOR WORKING- STORAGE The Purpose of VALUE Clauses 1. Level 01 may be used to define a group of independent or elementary items. These independent elementary items would be coded on a level subordinate to A user-defined data-name or identifier defines each field. 3. The size of a field and its data type are defined by the PIC clause. 4. An initial value may be stored in the field by a VALUE clause defined on the elementary level. VALUE clauses may also be used on the group level for initializing a series of fields.

Structured COBOL Programming, Stern & Stern, 9th Edition DEBUGGING TIP It is best to initialize fields in WORKING-STORAGE with VALUE clauses rather than with MOVE statements in the PROCEDURE DIVISION. –You are more apt to remember to initialize at the time you are defining the fields.

Structured COBOL Programming, Stern & Stern, 9th Edition DEBUGGING TIP Failure to initialize a field used in an arithmetic operation is a frequent cause of program interrupts. Be sure to use a VALUE of zeros to initialize all numeric fields prior to processing.

Structured COBOL Programming, Stern & Stern, 9th Edition COBOL CHANGES 1. The LABEL RECORDS clause will be phased out entirely. 2. VALUE clauses will be permitted in the FILE SECTION for defining initial contents of fields. 3. The way nonnumeric literals are continued will change. The hyphen from the continuation column (7) will be eliminated. Instead, you will add a - on the line being continued.

Structured COBOL Programming, Stern & Stern, 9th Edition COBOL CHANGES 4. As noted previously, rules for Margins A and B will become guidelines rather than requirements. 5. Commas and dollar signs will be permissible in numeric literals. Thus, $1, would be a valid numeric literal.

Structured COBOL Programming, Stern & Stern, 9th Edition CHAPTER SLIDES END HERE CHAPTER SUMMARY COMES NEXT

Structured COBOL Programming, Stern & Stern, 9th Edition CHAPTER SUMMARY A. Data Organization 1. File - The major classification of data for a specific business use or application. 2. Record - Data within a file that contains a unit of information. 3. Field - A group of consecutive positions reserved for an item of data.

Structured COBOL Programming, Stern & Stern, 9th Edition CHAPTER SUMMARY B. Types of Data 1. Variable Data - Data that varies with each run. 2. Constant or Literal - Data that is defined within the program; it is not entered as input to the system. Numeric Literal - A constant that may be used in the PROCEDURE DIVISION for arithmetic operations.

Structured COBOL Programming, Stern & Stern, 9th Edition SUMMARY B2. Constants or Literals (continued) –Nonnumeric Literal - A constant that may be used in the PROCEDURE DIVISION for all operations except arithmetic. –Figurative Constant - A COBOL reserved word with special significance to the compiler (e.g.., ZERO or ZEROES or ZEROS; SPACE or SPACES).

Structured COBOL Programming, Stern & Stern, 9th Edition SUMMARY C. The FILE SECTION 1. FD Entries FD is coded in Area A. The file-name, which is typically coded in Area B, must be the same name that is used in the SELECT statement.

Structured COBOL Programming, Stern & Stern, 9th Edition SUMMARY C. The FILE SECTION (continued) CLAUSES LABEL RECORDS ARE{OMITTED}{ STANDARD} RECORD CONTAINS integer CHARACTERS BLOCK CONTAINS integer RECORDS. All clauses are optional for COBOL85. LABEL RECORDS is required for COBOL78. After any clauses have been specified, a single period ends the FD.

Structured COBOL Programming, Stern & Stern, 9th Edition SUMMARY 2. Record Description Entries –Record-names are coded on the 01 level. –Field-names are coded on levels –Level 01 is coded in Area A. All other levels are coded in Area B for COBOL 74, although Area A can be used for COBOL 85.

Structured COBOL Programming, Stern & Stern, 9th Edition SUMMARY 2. Record Description Entries –Items with higher-level numbers are considered subordinate to, or contained within, items with lower-level number. –Group items are further subdivided; elementary items are not.

Structured COBOL Programming, Stern & Stern, 9th Edition SUMMARY 2. Record Description Entries –Only elementary items have PICTURE or PIC clauses to describe the data: X - alphanumeric A - alphabetic 9 - numeric V - implied decimal position (used only with numeric fields) – A period must follow a PICTURE clause in an elementary item; a period directly follows a group item name.

Structured COBOL Programming, Stern & Stern, 9th Edition SUMMARY 2. Record Description Entries (4 OF 4) –Fields must be defined in the DATA DIVISION in the same sequence as they appear in the record being described. –FILLER is a COBOL reserved word used to define areas within a record that will not be referenced individually during processing. With COBOL 85, a blank field- name can be used instead of the word FILLER.

Structured COBOL Programming, Stern & Stern, 9th Edition SUMMARY D. The WORKING-STORAGE SECTION 1. Used for storing intermediate results, counters, end-of-file indicators, and interactive data to be displayed or accepted as input. 2. VALUE clauses may be used to initialize fields.