Category: Basic

  • Table Processing

    Arrays in COBOL are known as tables. An array is a linear data structure and is a collection of individual data items of same type. Data items of a table are internally sorted. Table Declaration Table is declared in Data Division. Occurs clause is used to define a table. Occurs clause indicates the repetition of data name…

  • String Handling

    String handling statements in COBOL are used to do multiple functional operations on strings. Following are the string handling statements − Inspect Inspect verb is used to count or replace the characters in a string. String operations can be performed on alphanumeric, numeric, or alphabetic values. Inspect operations are performed from left to right. The…

  • Loop Statements

    There are some tasks that need to be done over and over again like reading each record of a file till its end. The loop statements used in COBOL are − Perform Thru Perform Thru is used to execute a series of paragraph by giving the first and last paragraph names in the sequence. After…

  • Conditional Statements

    Conditional statements are used to change the execution flow depending on certain conditions specified by the programmer. Conditional statements will always evaluate to true or false. Conditions are used in IF, Evaluate, and Perform statements. The different types of conditions are as follows − IF Condition Statement IF statement checks for conditions. If a condition…

  • Basic Verbs

    COBOL verbs are used in the procedure division for data processing. A statement always start with a COBOL verb. There are several COBOL verbs with different types of actions. Input / Output Verbs Input/Output verbs are used to get data from the user and display the output of COBOL programs. The following two verbs are…

  • Data Types

    Data Division is used to define the variables used in a program. To describe data in COBOL, one must understand the following terms − 01 TOTAL-STUDENTS PIC9(5) VALUE ‘125’. | | | | | | | | | | | | Level Number Data Name Picture Clause Value Clause Data Name Data names must be…

  • Basic Syntax

    Character Set ‘Characters’ are lowest in the hierarchy and they cannot be divided further. The COBOL Character Set includes 78 characters which are shown below − Sr.No. Character & Description 1 A-ZAlphabets(Upper Case) 2 a-zAlphabets (Lower Case) 3 0-9Numeric 4  Space 5 +Plus Sign 6 –Minus Sign or Hyphen 7 *Asterisk 8 /Forward Slash 9…

  • Program Structure

    A COBOL program structure consists of divisions as shown in the following image − A brief introduction of these divisions is given below − You can co-relate the above-mentioned terms with the COBOL program in the following example − PROCEDUREDIVISION. A0000-FIRST-PARA SECTION. FIRST-PARAGRAPH.ACCEPT WS-ID – Statement-1 —–| MOVE’10’TO WS-ID – Statement-2 |– Sentence-1DISPLAY WS-ID -…

  • Environment Setup

    We have set up the COBOL Programming environment online, so that you can compile and execute all the available examples online. It gives you confidence in what you are reading and enables you to verify the programs with different options. Feel free to modify any example and execute it online. IDENTIFICATIONDIVISION.PROGRAM-ID. HELLO.PROCEDUREDIVISION.DISPLAY’Hello World’.STOPRUN. For most…

  • Overview

    Introduction to COBOL COBOL is a high-level language. One must understand the way COBOL works. Computers only understand machine code, a binary stream of 0s and 1s. COBOL code must be converted into machine code using a compiler. Run the program source through a compiler. The compiler first checks for any syntax errors and then converts…