COBOL language introduction and recommended introductory books (10 books)

COBOL (Common Business-Oriented Language) is a high-level programming language originally developed in 1959 by American entrepreneur Grace Hopper and the U.S. Department of Defense. COBOL is a programming language for business applications and data processing designed with a focus on readability and maintainability.

Following are some of the main features and properties of COBOL language −

1. Oriented to business applications: COBOL was originally developed for business applications, and is particularly good at processing large amounts of data and complex business rules.

2. Natural language style: COBOL adopts a grammar close to natural language, making the program easy to understand and maintain. It uses English-like verbs and nouns to describe operations and data.

3. Data processing: COBOL provides a wealth of data processing functions, including file processing, record processing, sorting and merging, etc.

4. Hierarchical programming: COBOL supports dividing programs into multiple hierarchies and modules to improve readability and maintainability. Programmers can use a hierarchical programming style to organize and manage large codebases.

5. Data description: COBOL provides a powerful data description function, which can define different types of data and data structures, such as strings, numbers, dates, and tables.

6. Database integration: COBOL language is well integrated with major database systems (such as IBM's DB2 and Oracle), and COBOL can be used to operate and query databases.

7. Cross-platform compatibility: COBOL can run on various operating systems and computer platforms, including large machines and small machines.

8. Unconventional elements: COBOL also has some unique features, such as graphics processing, report generation, and transaction processing.

Although COBOL is an old-fashioned programming language, it is still widely used in business systems in finance, insurance, banking, and other enterprise fields. Many legacy systems still use COBOL and need to be maintained and updated. Additionally, the readability and maintainability of COBOL make it a good choice for beginners to learn programming.

Whether the COBOL language will be eliminated

Although some people think that the COBOL language is outdated and may be eliminated, the fact is that COBOL is still widely used in many business fields. Here are some reasons why COBOL is unlikely to be phased out anytime soon:

  1. Large number of existing systems: Many business-critical systems and core banking systems are still written in COBOL. These systems carry important business operations and data processing tasks, and replacing them would cause huge costs and risks.

  2. High Stability and Robustness: The COBOL language has been extensively tested and verified, and has been proven to be highly stable and robust over many years of practice. It can handle large-scale data and complex business rules to ensure the reliability and correctness of the system.

  3. Ease of maintenance and repair: Due to the high readability of the COBOL language, this makes it relatively easy to maintain and repair existing commercial systems. This is an important consideration for organizations that don't want to risk a rebuild or rewrite.

  4. Inheritance of knowledge and skills: Many programmers and developers still have the knowledge and skills of COBOL programming, which makes the talent for maintaining and developing COBOL systems still available. In addition, many organizations are still training new COBOL programmers to ensure they can meet business needs.

Nonetheless, there are several factors that are gradually reducing the use of COBOL. For example, the emergence of emerging technologies and programming languages, and the need to deal with big data and cloud computing, etc. But given the large number of existing systems and the virtues of COBOL, it is expected that COBOL will continue to exist for a considerable time, rather than being phased out anytime soon.

The following are 10 recommended COBOL language introductory books with a brief introduction to them:

1. "Beginning COBOL for Programmers"
   Author: Michael Coughlan
   Introduction: This book is suitable for novices. It provides a concise and easy-to-understand introduction guide, covering the basic knowledge of COBOL, including syntax, data processing and file processing.

2. "Structured COBOL Programming"
   Authors: Nancy B. Stern, Robert A. Stern, James P. Ley
   Introduction: This book introduces the structured programming method of COBOL in detail, and helps readers understand and master the basics of COBOL through examples and exercises concept and technology.

3. "COBOL for the 21st Century"
   Authors: Nancy B. Stern, Robert A. Stern, James P. Ley
   Introduction: This book is a classic COBOL tutorial, covering the core concepts and programming skills of COBOL, including modules programming, file processing, and database integration.

4. "COBOL Programmers Swing with Java"
   Author: Erika Uffindell
   Introduction: This book introduces how to use COBOL and Java for programming, combines the characteristics of the two languages, and helps readers master the development skills of complex systems.

5. "Murach's Mainframe COBOL"
   Author: Mike Murach, Anne Prince
   Introduction: This book is suitable for readers who want to learn COBOL in the mainframe environment, covering the development and maintenance technology of COBOL on the mainframe system.

6. "COBOL Unleashed"
   Authors: David Myers, Brian Myers, Craig Myers
   Introduction: This book is a comprehensive COBOL reference manual, which introduces COBOL syntax, data processing, file processing and debugging techniques in detail.


   7. Author of "COBOL Programming: Problems and Solutions" : Leyton E. Wasburn
   Introduction: This book provides a large number of practical cases and problem solutions to help readers master COBOL programming technology through practical examples.

8. "An Introduction to Programming Using COBOL"
   Authors: MK Roy, D. Ghosh Dastidar
   Introduction: This book is suitable for beginners, providing a systematic COBOL introductory tutorial, from basic to advanced, and gradually guiding readers to learn COBOL programming.

9. "COBOL Programming: A Structured Approach"
   Author: Gary D. Brown
   Introduction: This book uses a structured programming approach to help readers build clear and maintainable COBOL programs, including logic design, data processing, and file operations.

10. "COBOL Programming using the .NET Framework"
    Author: Bruce B. Culbertson
    Introduction: This book guides readers to program using COBOL and the .NET framework, covering the development and integration of COBOL on the Microsoft platform.

The above books are good resources for getting started with COBOL language. They provide teaching and practical content from different angles and levels, and you can choose suitable books for learning according to your own needs.

Attached is the quick sort implemented by COBOL language:

The following is a sample code to implement the quicksort algorithm in COBOL language:

IDENTIFICATION DIVISION.
PROGRAM-ID. QUICKSORT.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 ARRAY-SIZE PIC 9(5).
01 NUMBERS OCCURS 1 TO 100 TIMES
            DEPENDING ON ARRAY-SIZE
            PIC 9(5).

PROCEDURE DIVISION.
MAIN-LOGIC.
    DISPLAY "Enter the size of the array: ".
    ACCEPT ARRAY-SIZE.

    PERFORM READ-NUMBERS.
    PERFORM QUICK-SORT(NUMBERS, 1, ARRAY-SIZE).
  
    DISPLAY "Sorted array: ".
    PERFORM PRINT-NUMBERS.

    STOP RUN.

READ-NUMBERS.
    DISPLAY "Enter the numbers: ".
    PERFORM VARYING I FROM 1 BY 1 UNTIL I > ARRAY-SIZE
        ACCEPT NUMBERS(I)
    END-PERFORM.

PRINT-NUMBERS.
    PERFORM VARYING I FROM 1 BY 1 UNTIL I > ARRAY-SIZE
        DISPLAY NUMBERS(I)
    END-PERFORM.

QUICK-SORT USING NUMBRS, LOW, HIGH.
    DECLARATIVES.
    SORT-EXIT SECTION.
        NOT ON EXCEPTION
        PERFORM SORT-EXIT-RTN
    END-SORT-EXIT SECTION.
    END DECLARATIVES.

    SORT NUMBERS LOW THRU HIGH ON ASCENDING KEY NUMBERS
        USING NUMBERS(THE COUNT OF NUMBERS IN NUMBERS LOW THRU HIGH).

    SORT-EXIT-RTN.
        EXIT.

This code first asks the user to enter the size of the array, and then enters the values ​​in the array. Next, it calls the QUICK-SORT program to sort the input array. Finally, it prints the sorted array.

The QUICK-SORT program uses COBOL's SORT statement for sorting. It takes an ARRAY as input, and a starting position LOW and an ending position HIGH. It sorts the subarrays of the array between the start position and the end position.

Please note that this example only shows one way to implement the quicksort algorithm using COBOL's SORT statement, there are other ways to implement it.

Guess you like

Origin blog.csdn.net/q6115759/article/details/131449208