Category: 02. Cobol

  • Database Interface

    As of now, we have learnt the use of files in COBOL. Now, we will discuss how a COBOL program interacts with DB2. It involves the following terms − Embedded SQL Embedded SQL statements are used in COBOL programs to perform standard SQL operations. Embedded SQL statements are preprocessed by the SQL processor before the…

  • Internal Sort

    Sorting of data in a file or merging of two or more files is a common necessity in almost all business-oriented applications. Sorting is used for arranging records either in ascending or descending order, so that sequential processing can be performed. There are two techniques which are used for sorting files in COBOL − Sort…

  • Subroutines

    Cobol subroutine is a program that can be compiled independently but cannot be executed independently. There are two types of subroutines: internal subroutines like Perform statements and external subroutines like CALL verb. Call Verb Call verb is used to transfer the control from one program to another program. The program that contains the CALL verb is the Calling Program and the program being…

  • File Access Mode

    Till now, file organization schemes have been discussed. For each file organization scheme, different access modes can be used. Following are the types of file access modes − The syntaxes in this module, mentioned along with their respective terms, only refer to their usage in the program. The complete programs using these syntaxes would be…

  • File Organization

    File organization indicates how the records are organized in a file. There are different types of organizations for files so as to increase their efficiency of accessing the records. Following are the types of file organization schemes − The syntaxes in this module, mentioned along with their respective terms, only refer to their usage in…

  • File Handling

    The concept of files in COBOL is different from that in C/C++. While learning the basics of ‘File’ in COBOL, the concepts of both languages should not be corelated. Simple text files cannot be used in COBOL, instead PS (Physical Sequential) and VSAM files are used. PS files will be discussed in this module. To understand file handling in…

  • 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…