Chapter 8 Printing 1. In COBOL you send data to the printer by writing data to a file. In COBOL, the printer is defined as a file, and it is opened, closed,

Slides:



Advertisements
Similar presentations
Buffers & Spoolers J L Martin Think about it… All I/O is relatively slow. For most of us, input by typing is painfully slow. From the CPUs point.
Advertisements

Creating and Editing a Web Page Using Inline Styles
2-1 Chapter 2.  Coding Requirements of IDENTIFICATION DIVISION  Sections of ENVIRONMENT DIVISION  Assigning Files to Devices in ENVIRONMENT DIVISION.
CPIT 102 CPIT 102 CHAPTER 1 COLLABORATING on DOCUMENTS.
Microsoft Office 2007: Introductory Computer Applications 11.
The IDENTIFICATION and ENVIRONMENT DIVISIONS Chapter 2.
Programming Logic and Design Fourth Edition, Introductory
Chapter 10 Chapter 10: Printer Management. Chapter 10 Learning Objectives n Describe the printing process used by Windows NT n Install a local printer.
MCT260-Operating Systems I Operating Systems I Using Text Editors.
An Introduction to Programming with C++ Fifth Edition Chapter 13 Sequential Access Files.
Guide To UNIX Using Linux Third Edition
Chapter 8: I/O Streams and Data Files. In this chapter, you will learn about: – I/O file stream objects and functions – Reading and writing character-based.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
Chapter 13: Sharing Printers on Windows Server 2008 R2 Networks BAI617.
Structured COBOL Programming, Stern & Stern, 9th Edition
Module 1.4 File management. Contents Introduction Windows Explorer The need to organise More about files Working with files Test and improve your knowledge.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
ACTIVITY 2 : UNDERSTAND THE WORKING OF DIFFERENT INPUT/OUTPUT HARDWARE DEVICES BRIDGE COURSE of INFORMATION & COMMUNICATION TECHNOLOGY.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
Topics Introduction Hardware and Software How Computers Store Data
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
Microsoft Office XP Illustrated Introductory, Enhanced Started with Word 2002 Getting.
1 The EDIT Program The Edit program is a full screen text editor that allows you to: Create text files Create text files Edit an existing text files Edit.
Basic Computer and Word Functions, part 1 Read the information and use to answer the questions in the Basic Computer and Word Functions Study Guide.
1 Screen and Keyboard Operations Suthida Chaichomchuen
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. word 2010 Chapter 5 Working with References and Mailings.
Agenda Reporting Work on Assignment 4! Printing on power systems.
Printing on power systems Program/ Command Data Report Layout (Printer File) Job Output Queue *FILE Spooled File.
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.
Programming Fundamentals. Today’s Lecture Why do we need Object Oriented Language C++ and C Basics of a typical C++ Environment Basic Program Construction.
Chapter 9 I/O Streams and Data Files
Advanced samples Printing two types of labels from two different custom forms We have two different labels that contain the same data. One is suitable.
An Introduction to Programming with C++ Sixth Edition Chapter 14 Sequential Access Files.
Lesson 1 Operating Systems, Part 1. Objectives Describe and list different operating systems Understand file extensions Manage files and folders.
INPUT / OUTPUT STATEMENTS
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.
The Professional Touch Programming Right from the Start with Visual Basic.NET 1/e 10.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
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)
Page 1 Printing & Terminal Services Lecture 8 Hassan Shuja 11/16/2004.
1.  Introduction  The Benefits of the Report Writer Module ◦ For Detail and Summary Printing ◦ For Control Break Processing ◦ For Printing Headings.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
AIX 3.x, 4.x Adding and Configuring a Print Queue For ASCII Text Files.
Control Code
Week 2/3 - 2nd Lecture Intro to COBOL Programming Defining Files and Processing Data.
Chapter 6. Copyright 2003, Paradigm Publishing Inc. CHAPTER 6 BACKNEXTEND 6-2 LINKS TO OBJECTIVES Create Folders Select Delete Copy a Document Move a.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
NXT File System Just like we’re able to store multiple programs and sound files to the NXT, we can store text files that contain information we specify.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
File I/O. I/O Flags Flags are passed to give some information about how the file is to be used. – Read only file – flag=0x0 – Write only file – flag=0x1.
Chapter 1: Introduction to Computers and Programming
Sorting in COBOL M. M. Pickard.
Arithmetic Expressions Function Calls Output
Topics Introduction Hardware and Software How Computers Store Data
Chapter 13: File Input and Output
Learning about Taxes with Intuit ProFile
An Introduction to Structured Program Design in COBOL
Structured COBOL Programming
Topics Introduction Hardware and Software How Computers Store Data
Chapter 14 Sorting and Merging.
Learning about Taxes with Intuit ProFile
New Perspectives on Windows XP
Text Book Homework FORMAT Instructions:
CHAPTER 17 The Report Writer Module
Introduction to C Programming
Chapter 4: Writing and Designing a Complete Program
Presentation transcript:

Chapter 8 Printing 1

In COBOL you send data to the printer by writing data to a file. In COBOL, the printer is defined as a file, and it is opened, closed, and written to as though it were a file. Like any file, the printer file requires both a logical and a physical definition. 2

Printing 3

A normal disk file is assigned to a filename on the disk. A printer file is assigned to the COBOL reserved word PRINTER. the ORGANIZATION for the printer file is changed to LINE SEQUENTIAL. A line sequential file is similar to a sequential file, but it usually has carriage return and line feed characters added to the end of each record These are added automatically every time a record is written. This format is suitable for printing or displaying. 4

Printing The format also is suitable for a file that is to be edited using a text editor. In fact, the source code files that you are editing whenever you write a program are line sequential files. In this case, the printer file is organized as a line sequential file because a carriage return and line feed are "added" at the end of each line and are sent to the printer to cause the print head to return to the left margin (carriage return) and drop down one line (line feed). 5

Printing ORGANIZATION IS LINE SEQUENTIAL is commonly used in many versions of COBOL for the organization of the printer file, but it is not the only organization. – Others organizations ORGANIZATION IS SEQUENTIAL ORGANIZATION IS PRINTER. 6

Printing On larger computers with many users and one or more printers, writing to the printer file actually writes to a temporary file on the disk. When the printer file is closed, the temporary file is passed on to another program that handles the scheduling of the printers. The scheduling program usually is called a spooler or a print queue manager. This program sends the temporary file to the printer. 7

Printing A data file uses LABEL RECORDS ARE STANDARD, and a print file uses LABEL RECORDS ARE OMITTED. A printer is a device and does not require labeling (filenames). 8

Printing 9

Controlling the Printer In addition to printing a string of characters on paper, a COBOL program has to tell the printer when to advance one line down the page. It also might have to tell the printer when to advance to the next page. When a WRITE command is used on a printer file, the command can include instructions to force the printer to advance one or more lines. 10

Controlling the Printer The BEFORE ADVANCING phrase causes one or more carriage return and line feed characters to be sent to the printer after the line is printed. The BEFORE ADVANCING and AFTER ADVANCING clauses of the WRITE verb are called carriage control clauses or carriage control information. They control the positioning of the print head before or after a line is printed. 11

Controlling the Printer 12

Controlling the Printer Refer to the sample program at the sample program folder. The further operation of the printing will be discuss in the lab session. 13