# Cobol

Topics: COBOL, Character encoding, Picture clause Pages: 136 (43832 words) Published: August 24, 2013
This watermark does not appear in the registered version - http://www.clicktoconvert.com

1

BACHELOR OF COMPUTER APPLICATIONS (BCA) COBOL
CONTENTS Syllabus
UNIT –1 Lesson-1 Lesson-2 Lesson-3 Lesson-4 Lesson-5 UNIT – 2 Lesson-6 Lesson-7 Lesson-8 Lesson-9 Lesson-10 UNIT – 3 Lesson-11 Lesson-12 Lesson-13 Lesson-14 Lesson-15 UNIT– 4 Lesson-16 Lesson-17 Lesson-18 Lesson-19 Lesson-20 UNIT – 5 Lesson-21 Lesson-22 Lesson-23 Lesson-24 Lesson-25 Introduction to COBOL Divisions of COBOL Picture clause characteristics Editing Level Structure PAGE NO 1 9 16 20 26

Data Movement verb: MOVE Arithmetic Verbs Input and Output Verbs Corresponding Options Programs using Arithmetic Verbs

30 34 41 48 54

Conditions Conditionals Statements PERFORM statements RENAMES & REDEFINES Clauses Programs

60 70 77 82 86

Sequential Files Direct Access Files Indexed Sequential Files Sorting and Merging of Files Programs

92 98 102 107 114

Table Handling Indexed Tables & Index Names Search & Start Verbs Programs using OCCURS & Screen Section List of Programs

123 128 132 136 142

This watermark does not appear in the registered version - http://www.clicktoconvert.com

2

UNIT – I

LESSON – 1: INTRODUCTION TO COBOL
CONTENTS 1.0 Aims and Objectives 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 History of COBOL FORMAT FOR COBOL PROGRAMS STRUCTURE OF A COBOL PROGRAM CHARACTER SET COBOL WORDS DATA NAMES AND IDENTIFIERS LITERALS Language Description Notation Let us Sum up Lesson-end Activities Points for Discussion References

1.0 AIMS AND OBJECTIVES In this lesson, the learner will be introduced the History of Cobol , Structure of a COBOL program, Character set, words, data names and identifiers and Literals of COBOL. The objective here is to familiarize him the prerequisites to understand the language. 1.1 HISTORY OF COBOL 0In 1959, the new language named COBOL (COmmon Business Oriented Language) was introduced keeping in mind the business purpose applications. The board of directorate which is known as CODASYL (Conference on DATA System Language) COBOL programming language committee established a COBOL maintenance committee to keep COBOL in step with the times. The first COBOL compiler became available in early 1962. The next version with some new additions was published in 1965. In August 1968 a standard version of the language was approved by the American National Standard Institute (ANSI). This standard version was again modified in 1974 and is known as ANSI-74 COBOL or COBOL -74. The revision process has been continuous and in 1985 a revised standard was introduced. This standard was known as COBOL-85. 1.2 FORMAT FOR COBOL PROGRAMS COBOL is a high- level language. Hence, a COBOL program can be executed on a computer for which a COBOL compiler is available. The compiler translates a COBOL

This watermark does not appear in the registered version - http://www.clicktoconvert.com

3

source program into the machine language object program. This object program is really executed. COBOL programs are written in coding sheets. There are 80 columns in a line of the coding sheet. The page number is coded in columns 1-3 and the line numbers are coded in columns 4-6. The page and line numbers together is called the sequence number. Depending on the type, the entries are coded both from column 8 or column 12 and in both cases it can be continued up to column 72. Columns 73-80 can be used to write some identification. The compiler ignores anything that is given in columns 73-80 except when a printed copy of the program is provided by the compiler in which case the entries in columns 73-80 are also listed. The use of the sequence number is also optional and can be omitted. However, when sequence numbers are provided they must appear in ascending order. Column 1-3 4-6 7 8-11 12-72 73-80 Field Page Number Line Number (1-6 Sequence Number) Continuation / Comment A – Margin / Area A B- Margin /Area B Identification

In COBOL...