This action might not be possible to undo. Are you sure you want to continue?
• • • • • • •
Know what the acronym COBOL stands for. Be aware of the significance of COBOL in the marketplace. Understand some of the reasons for COBOL's success. Be able to understand COBOL Metalanguage syntax diagrams. Be aware of the COBOL coding rules Understand the structure of COBOL programs Understand the purpose of the IDENTIFICATION, ENVIRONMENT, DATA and PROCEDURE divisions.
It emphasizes describing and handling of data items and of input/output records. responsibility for developing new COBOL standards has been assumed by the American National Standards Institute (ANSI). thus it is well adapted for managing large files of data. COBOL is especially efficient for processing business problems. Since then.COBOL is a high-level programming language first developed by the CODASYL Committee (Conference on Data Systems Languages) in 1960. Common Business Oriented Language (COBOL) is a programming language that resembles English. .
to AS/400. DG. Early indications from the year 2000 problem are that COBOL applications were actually cheaper to fix than applications written in more recent languages. COBOL is Maintainable: COBOL has a 30 year proven track record for application maintenance.from every favour of Windows. VM. OS/2. . The vendor independent ANSI COBOL committee legislates formal. to every falser of Unix. COBOL has been ported to virtually every hardware platform . VMS. nonvendor-specific syntax and semantic language standards. Unisys. DOS.COBOL is non-proprietary (portable): The COBOL standard does not belong to any particular vendor. enhancement and production support at the enterprise level. VSE. and MVS.
Identification Division 2. Data Division 4. They are : 1.There are four divisions in a COBOL program . Environment Division 3. Procedure Division .
08/27/88. 09/01/88 12:57:53. PROGRAM-ID. COBOL DEVELOPMENT CENTER. INSTALLATION. DATE-WRITTEN. IDSAMPLE. It names the program and may include the date the program was written. and other such documentary information about the program. . NON-CONFIDENTIAL. Code Example: IDENTIFICATION DIVISION. DATE-COMPILED. AUTHOR.the date of compilation. PROGRAMMER NAME.Identification Division The Identification Division must be the first division in every COBOL source program. SECURITY.
assigns the file to one or more input/output devices. SOURCE-COMPUTER. SPECIAL-NAMES. CONFIGURATION SECTION.Environment Division The Environment Division has two sections: •The Configuration Section •The Input-Output Section. and also specifies information needed for efficient transmission of data between the external medium and the COBOL program. Code Example: ENVIRONMENT DIVISION. identifies its external storage medium. C01 IS TOP-OF-PAGE. IBM-AS400. OBJECT-COMPUTER. The Configuration Section is optional. . The Input-Output Section defines each file. IBM-AS400.
File Section 2.Data Division : Sections 1. Linkage Section Linkage section is used only in the called program when parameters are passed programs. . Working Storage 3.
else Perform..Procedure Division Constructs that can be used in the Procedure Division are : If.....when File commands: READ WRITE REWRITE DELETE ....until Evaluate..
. DDM files 4.File categories in AS/400 : 1. Database files 2. Device files 3. There are two types of database files: physical files and logical files. Save files A database file is subdivided into groups of records called members.
. Logical Files: A logical file is a database file through which data from one or more physical files can be accessed. The format and organization of this data is different from that of the data in the physical file(s). all of which have the same format. Device Files : A device file reads from or writes to a device or remote system. A device file controls the transfer of data between the physical device or remote system and the program.Physical Files: A physical file is a file that actually contains data records. A physical file can contain only fixed-length records.
add. Save Files : A save file is a file that is used to prepare data in a format that is correct for backup and recovery purposes or for transportation to another system. You can retrieve. update. . DDM files are supported by the COBOL compiler.DDM Files : Distributed Data Management (DDM) allows you to access data that reside on remote systems that support DDM. or delete data records in a file that resides on another system. A save file can be used to contain the output that is produced from the Save Library (SAVLIB) or Save Object (SAVOBJ) CL commands.
Paragraphs : The Input-Output section of the Environment Division contains two paragraphs: • FILE-CONTROL paragraph • I-O-CONTROL paragraph. FILE-CONTROL paragraph Names and associates the files with the external media. I-O CONTROL paragraph Specifies information needed for efficient transmission of data between external media and the COBOL program FILE-CONTROL Paragraph The FILE-CONTROL paragraph associates each file in the COBOL program with an external medium. and be followed by a separator period. It must begin in Area A. . and specifies file organization. and other information. access mode.
Access Modes Access mode is a COBOL term that defines the manner in which data in a logical or physical file is to be processed. and dynamic.In COBOL you can specify any of four types of data organization. The three access modes are sequential. relative. Records can be fixed or variable in length. Data Organization In a COBOL program. random.COBOL allows for four distinct kinds of file input and output: • Sequential • Indexed • Relative Data Organization and Access Modes: Data organization is the permanent logical structure of the file. data organization can be sequential. indexed. . and three access modes. or TRANSACTION. You tell the computer how to retrieve records from the file by specifying the access mode.
The COBOL program (source code ) should be compiled to produce a usable object code. This is done using the CRTCBLPGM command or keying in the option 14 against the source code. . The program can be compiled either in batch or interactively.
Using the COBOL CALL command. . Using a menu driven option. 2. 3. issuing a user created command. 4.The most common ways of running a COBOL program are : 1 Using the CL CALL command.
Missing copy files 3. Misuse of reserved words . Faulty punctuation especially missing periods 5. Incorrect or incomplete syntax 6. Unmatched record descriptions with externally described files.Common coding mistakes include : 1. 2. Misspellings 4.
12 subfiles can be displayed on device at the same time. The subfile record format contains the field descriptions for the records in the subfile. . That is. Subfiles can be specified in the DDS for a display file to allow you to handle multiple records of the same type in a display. Records to be included in the subfile are specified in the DDS for the file One file can contain more than one subfile but only 12subfiles can be active concurrently for a device. the subfile record format and the subfile control record format.A subfile is a group of records read from or written to a display device. The DDS of a subfile contains 2 record formats.
. A relative key is an unsigned number that can be used directly by the system to locate a record in a file. To use a subfile for a display file in a COBOL program . READ SUBFILE file-name record 2. Valid subfile operations are : 1. but does not affect the displayed data directly. you must specify the SUBFILE phrase with the Input/Output operation. WRITE or REWRITE causes the specified subfile record to be processed.Specifiations of the subfile record format on a READ. or processed randomly by specifying a relative key value. REWRITE SUBFILE record-name Subfiles are processed sequentially using READ SUBFILE NEXT MODIFIED statement. WRITE SUBFILE record name 3.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.