COBOL Screens Please use speaker notes for additional information!

Slides:



Advertisements
Similar presentations
Check Digit - Mod 11 Please use speaker notes for additional information!
Advertisements

Final Total Lines in COBOL Please be sure you can see the speaker notes - they contain additional information!
Chapter 15 Indexed Sequential Files. Disk File Organization File is collection of records Three major ways records stored or organized on disk - Sequential.
Screen Section Please use speaker notes for additional information!
Processing with VSAM Files Please use speaker notes for additional information!
Objectives In this chapter, you will learn about:
Chapter 5: Loops and Files.
Flowcharts Remember that a solution to a problem is called an algorithm. Algorithms are often a series of steps required to solve the problem. A flowchart.
COBOL for the 21 st Century Stern, Stern, Ley Chapter 1 INTRODUCTION TO STRUCTURED PROGRAM DESIGN IN COBOL.
COBOL COmmon Business Oriented Language  Work began in 1959 and has never stopped.
COBOL for the 21st Century
Two and three dimension tables Please use speaker notes for additional information!
Any Questions!. Agenda Fun with Functions –how to get the system date Condition Names INDARA and SI Iteration Logical Files Positioning the file pointer.
Relative Files.. Creating a Relative File $ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. CreateRelativeFromSeq. * Creates a Relative file.
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)
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.
Chapter To familiarize you with  Why COBOL is a popular business-oriented language.  Programming practices and techniques  History of COBOL.
Introduction to COBOL. COBOL  COBOL is an acronym which stands for Common Business Oriented Language.  The name indicates the target area of COBOL applications.
Modifications to program Addda.cbl Please use speaker notes for additional information!
History COBOL (Common Business Oriented Language) was one of the earliest high-level programming languages. COBOL was first proposed in 1959 by the Conference.
CNG 140 C Programming (Lecture set 9) Spring Chapter 9 Character Strings.
Programming Examples to Accompany Structure Topic Please use speaker notes for additional information!
Totals on the Screen Please use speaker notes for additional information!
Logic Structure - focus on looping Please use speaker notes for additional information!
Lecture 31 Numeric Edited Alphabetic (A) AlphaNumeric (X) Numeric (9, V, S) Numeric Edited (9, Z, comma, decimal point, minus sign) –Z = zero suppressed.
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.
1 Interactive vs Batch Programs Cobol suited for developing both types of programs Interactive programs Accept input data from keyboard Input data processed.
Array - adding to array at run time Please see speaker notes for additional information!
Chapter 7 File I/O 1. File, Record & Field 2 The file is just a chunk of disk space set aside for data and given a name. The computer has no idea what.
Indexed and Relative File Processing
Edit Programs Please use speaker notes for additional information. Example: payedit.cbl payedit.cbl.
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.
Statement Syntax1 THE SELECT STATEMENT Purpose: designates a file and points to its physical location Syntax Definition : SELECT file-name-1 ASSIGN TO.
CPSC3111/CISM3111 COBOL Structured COBOL Programming Text: murach’s structured COBOL Authors: Murach, Prince, Menendez.
Visual Basic Programming
Explanation of SAMPLEIF (if88in1.cbl or if88in1.html) Please use speaker notes for additional information!
Order Entry Program Please see speaker notes for additional information!
HELLO WORLD program in COBOL - CIS12 Please use speaker notes for additional information!
Any Questions!. Test Coming Up! Agenda Printing with Externally Described Printer Files Arrays.
1 Chapter 5 – The Procedure Division File handling statements –OPEN statement Initiates processing for a file Input Output Each file opened must have been.
Two Forms Please use speaker notes for additional information!
13-1 Sequential File Processing Chapter Chapter Contents Overview of Sequential File Processing Sequential File Updating - Creating a New Master.
Chapter 2 Using Variables and Constant. What is a Constant ? The data in COBOL programs falls in two broad categories: – Constants and Variables A constant.
1.  Introduction  The Benefits of the Report Writer Module ◦ For Detail and Summary Printing ◦ For Control Break Processing ◦ For Printing Headings.
IBM-Mainframes COBOL Class-1. Background and History  COBOL is an acronym for: Common Business Oriented Language  COBOL was developed in 1959 by the.
Module 1 1. Cobol Hierarchy Revised on COBOL Hierarchy There are four DIVISIONS:- IDENTIFICATION DIVISION. ENVIRONMENT DIVISION. DATA DIVISION.
13- 1 Chapter 13.  Overview of Sequential File Processing  Sequential File Updating - Creating a New Master File  Validity Checking in Update Procedures.
Loops and Files. 5.1 The Increment and Decrement Operators.
Analysis of SAMPLE1.CBL Please check speaker notes for additional information!
Indexed Files.. Creating an Indexed File $ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. CreateIndexedFromSeq. * Creates an indexed file.
Chapter 4 PROCEDURE DIVISION. Paragraphs PROCEDURE DIVISION divided into paragraphs Each is independent module or routine Made up of series of instructions.
The PERFORM. The PERFORM Verb  Iteration is an important programming construct. We use iteration when we need to repeat the same instructions over and.
Random update Please use speaker notes for additional information!
Sequential Processing to Update a File Please use speaker notes for additional information!
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.
General Introduction Algorithms. Let’s write a program  A program is a collection of statements written in a language the computer understands.  A computer.
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.
Any Questions?.
Chapter 3 The DATA DIVISION.
Please use speaker notes for additional information!
An Introduction to Structured Program Design in COBOL
Minor, Intermediate and Major Breaks
Chapter 14 Sorting and Merging.
Indexed File Processing
Using screens and adding two numbers - addda.cbl
Date Conversion Program
Presentation transcript:

COBOL Screens Please use speaker notes for additional information!

Scrntest.cbl IDENTIFICATION DIVISION. PROGRAM-ID. SCROCCUR. AUTHOR. GROCER. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT INPUT-FILE ASSIGN TO "C:\PCOBWIN\CIS12FST\SCR1.DAT". DATA DIVISION. FILE SECTION. FD INPUT-FILE DATA RECORD IS INPUT-REC. 01 INPUT-REC. 05 ID-IN PIC XXXX. 05 NAME-IN PIC X(20). WORKING-STORAGE SECTION. 01 INDICATORS. 05 EOF-IND PIC XXX VALUE "NO ". 01 RESPONSES. 05 SCR-RESP-WS PIC X VALUE SPACES. 05 CUR PIC 99 VALUE CT PIC 9 VALUE 0. Information from the screen is stored here. Responses used in processing.

SCREEN SECTION. 01 DATA-SCREEN. 05 HDR-INFO. 10 VALUE "DATA SCREEN" BLANK SCREEN LINE 01 COL VALUE "ID #" LINE 03 COL VALUE "NAME" LINE 03 COL INFO-SCR-IN. 10 ID-ON-SCR-IN LINE CUR COL 12 PIC XXXX FROM ID-IN. 10 NAME-ON-SCR-IN LINE CUR COL 17 PIC X(20) FROM NAME-IN. 05 RESP-INFO. 10 VALUE "C - TO CONTINUE" LINE 16 COL VALUE "Q - TO QUIT" LINE 17 COL VALUE "ENTER CHOICE:" LINE 19 COL RESPONSE-SCR LINE 19 COL 45 PIC X TO SCR-RESP-WS. PROCEDURE DIVISION. MAINLINE. PERFORM A-100-INITIALIZE. PERFORM B-100-PROCESS. PERFORM C-100-TERMINATE. STOP RUN. Scrntest.cbl Header information displayed at the top of the screen. Detail information displayed on the current line. Note that CUR is set to 4 and will be incremented so the first line is displayed on line 5. This structure allows the programmer to display multiple copies of INFO- SCR-IN. The user will enter either C to continue or Q to quit when the RESP-INFO portion of the screen is displayed.

Screen showing output HDR-INFO INFO-SCR-IN RESP-INFO

A-100-INITIALIZE. OPEN INPUT INPUT-FILE. B-100-PROCESS. READ INPUT-FILE AT END MOVE "YES" TO EOF-IND. PERFORM B-200-LOOP UNTIL EOF-IND = "YES" OR SCR-RESP-WS = "Q". B-200-LOOP. MOVE 4 TO CUR. MOVE 0 TO CT. DISPLAY HDR-INFO. PERFORM B-300-SETUP UNTIL CT > 4 OR EOF-IND = "YES" OR SCR-RESP-WS = "Q". DISPLAY RESP-INFO. ACCEPT RESP-INFO. B-300-SETUP. ADD 1 TO CUR. ADD 1 TO CT. DISPLAY INFO-SCR-IN. READ INPUT-FILE AT END MOVE "YES" TO EOF-IND. C-100-TERMINATE. CLOSE INPUT-FILE. Scrntest.cbl Displays the header information on the screen. Performs the routine which will put up the repeating lines of information until either CT which counts the record is greater than 4, or EOF is reached or the user quits. In this B-300-SETUP loop,1 is added to the current line, CUR and to the CT which is counting the records. Then the information is displayed and another record is read. When the B-300-SETUP loop is finished, the response screen is displayed and the user response is accepted. This ends the pass through the B-200-LOOP,

IDENTIFICATION DIVISION. PROGRAM-ID. SCROCCUR. AUTHOR. GROCER. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT INPUT-FILE ASSIGN TO "C:\PCOBWIN\CIS12FST\SCR1.DAT". DATA DIVISION. FILE SECTION. FD INPUT-FILE DATA RECORD IS INPUT-REC. 01 INPUT-REC. 05 ID-IN PIC XXXX. 05 NAME-IN PIC X(20). WORKING-STORAGE SECTION. 01 INDICATORS. 05 EOF-IND PIC XXX VALUE "NO ". 01 RESPONSES. 05 SCR-RESP-WS PIC X VALUE SPACES. 05 CUR PIC 99 VALUE SUBZ PIC 9 VALUE DATA-FOR-SCREEN. 05 INFO-FOR-SCR OCCURS 5 TIMES. 10 ID-IN-WS PIC XXXX. 10 NAME-IN-WS PIC X(20). Scroccur.cbl

SCREEN SECTION. 01 DATA-SCREEN. 05 HDR-INFO. 10 VALUE "DATA SCREEN" BLANK SCREEN LINE 01 COL VALUE "ID #" LINE 03 COL VALUE "NAME" LINE 03 COL INFO-SCR-IN. 10 ID-ON-SCR-IN LINE CUR COL 12 PIC XXXX FROM ID-IN-WS (SUBZ). 10 NAME-ON-SCR-IN LINE CUR COL 17 PIC X(20) FROM NAME-IN-WS (SUBZ). 05 RESP-INFO. 10 VALUE "C - TO CONTINUE" LINE 16 COL VALUE "Q - TO QUIT" LINE 17 COL VALUE "ENTER CHOICE:" LINE 19 COL RESPONSE-SCR LINE 19 COL 45 PIC X TO SCR-RESP-WS. PROCEDURE DIVISION. MAINLINE. PERFORM A-100-INITIALIZE. PERFORM B-100-PROCESS. PERFORM C-100-TERMINATE. STOP RUN. Scroccur.cbl 01 DATA-FOR-SCREEN. 05 INFO-FOR-SCR OCCURS 5 TIMES. 10 ID-IN-WS PIC XXXX. 10 NAME-IN-WS PIC X(20).

A-100-INITIALIZE. OPEN INPUT INPUT-FILE. B-100-PROCESS. READ INPUT-FILE AT END MOVE "YES" TO EOF-IND. PERFORM B-200-LOOP UNTIL EOF-IND = "YES" OR SCR-RESP-WS = "Q". B-200-LOOP. MOVE 4 TO CUR. MOVE 0 TO SUBZ. DISPLAY HDR-INFO. PERFORM B-300-SETUP UNTIL SUBZ > 4 OR EOF-IND = "YES" OR SCR-RESP-WS = "Q". DISPLAY RESP-INFO. ACCEPT RESP-INFO. B-300-SETUP. ADD 1 TO SUBZ. ADD 1 TO CUR. MOVE ID-IN TO ID-IN-WS(SUBZ). MOVE NAME-IN TO NAME-IN-WS (SUBZ). DISPLAY INFO-SCR-IN. READ INPUT-FILE AT END MOVE "YES" TO EOF-IND. C-100-TERMINATE. CLOSE INPUT-FILE. Scroccur.cbl The record that was read is in ID-IN and NAME-IN> These two fields are now moved to the table in WORKING-STORAGE that provides the information to the screen. A information is moved to the table, it is displayed on the screen.