COBOL language

COBOL language

COBOL, an acronym of Common Business-Oriented Language, defining its primary domain in finance, business and administrative system for large and medium group companies and governments, is one of oldest software programming language and still in active use. The Pentagon initialized COBOL in 1959 on May 29, and a Short Range Committee was formed, which was organized by Charles Phillips of United States Department of Defense. The objective of this committee was to recommend a short-range approach to a common business language. Its six core members were Burroughs Corporation, IBM, Honeywell Labs, Sperry Rand, RCA and Sylvania electric Products. However, this committee was never operational and in the end a sub committee of the Short Range Committee developed the specification of COBOL and completed its specification at the end of 1959 (Sammet, J.E. 1981).

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

Since its invention, American National Standards Institute (ANSI), including the following famous one, has produced several version of COBOL standard.

–                      COBOL-68

–                      COBOL-74

–                      COBOL-85

–                      COBOL-2002

Concepts of COBOL language

COBOL is a structured language. Programs, divisions, sections, and paragraphs, specify (in the order), identification, the operating environment, data descriptions, interfaces, and operational procedures. Programs allow encapsulation, or interface based programming. Modularity allows component substitution with minimal disruption, and is considered just as desirable for Software, as it is for hardware. Divisions, sections, and paragraphs, organize the program into logical elements of interface and internal definitions, data descriptions and procedural code.

COBOL is typically a Free Form language, with very minimal column sensitivity. COBOL allows long and descriptive names. This allows COBOL source to be written in a self-documenting style, which was an intended design goal. However, its verbosity has led to multiple abbreviations a person needs to master in order to become fluent (Edsger W. Dijkstra: How do we tell truths that might hurt)

Source structures of COBOL

Each COBOL program is composed of divisions. The identification division identifies the program. The environment division has a configuration section, which provides for the other facilities of the H-spec. The input-output section of the environment division defines the program files. The data division starts with the File section, which completes the definition of files and their records or I-O buffers, and proceeds with a Working-storage section for the definition of program variables, arrays, and data structures. A linkage section concludes the data division with the description of received parameters. A Procedure Division, whose sections are not predefined, follows these definitional sections.

Cobol 2002

The COBOL 2002 standard includes support for object-oriented programming and other prevailing features of software language. Its standards supports XML, UNICODE, generation and parsing, calling conventions from non-COBOL languages such as JAVA and C (including COBOL instantiated as EJBs). The 2002 standard is packed with enhancement and new features, out of which following major groups summarized and depicts how software interacts with the hardware and causes the system to function.

Inter-language Operability enhancements include “new” data types such as native binaries and floats, affect CALL for Application Programming Interfaces (API), and Object Orientation (already supported by a number of vendors for Graphical User Interfaces (GUI) and access to C++ and other Class Libraries).
Enhanced Input-Output include file sharing and record locking, non-contiguous keys, required Report-Writer facility, and character-addressable Terminal (CRT) interface.
Internationalization enhancements include support for POSIX Locales, National Character Sets (such as Unicode), multiple currency symbols and formatting rules, and other features
Enhanced Numeric Processing provides extremely large numeric items and “Standard Arithmetic” facilitate portable high-precision algorithms.
Enhanced Exception Handling for all of the above, such as new File Status conditions and refined declaratives for the file system enhancements.
Other enhancements such as conditional compilation and the data validation facility that allows data definitions to contain extensive data integrity rules (making their specification in copy books extremely attractive).
Transaction Processing (TP)
TP applications developed on S/390, DEC VMS, Wang VS, and Unix, have different program syntax and system capabilities. In other words, we could not choose one environment, and keep all the features. The new standard merges the best features in the market today, so we should be able to port (or even merge) applications onto any compliant COBOL platform. TP is a term describing a variety of environments with the following common characteristics: (Future of COBOL Vol5. Legacy J Corporation 2003)

Shared Data
High Volume
Asynchronous Activity
The major concerns in TP are preservation of data integrity with high performance. Preservation of data integrity is achieved by means of resource locks and their management.

Earlier COBOL standards allowed multiple users to open a file for concurrent input, but only one user could have a file open for Output, Extend, or I-O. While this guarantees data integrity, it is inefficient for concurrent access that includes both inquiries and updates, particularly to files with large numbers of records. The file sharing and record locking defined by the new standard allow transaction processing.

Locks, however, introduce the possibility of deadlocks. A two-user deadlock occurs when user1 requests and acquires a lock on resource1, then (incrementally) requests a lock on resource2, and is not approved it because resource2 is locked for user2. If at this stage user2 was to finish processing and release resource2, normal processing would resume, and user1 would experience only a minor delay. However, if at this point user2 requests a lock on resource1, a deadlock is established. Neither user1 nor user2 can proceed, and both resources are going to be un-available indefinitely.

In general, a deadlock occurs when a set of two or more users/processes request and are granted locks on an equal number of resources, and all are then blocked waiting for another in their set, forming a closed wait-circuit. A traffic jam is a typical example of a deadlock including more than two users, and presents us with the solution to the problem: someone has to go (roll) back. Our two requirements result in two questions that need to be addressed prior to rollback:

How does our system detect a deadlock?
How do we know where it is (back) we need to go?
There are two strategies for detecting deadlock. The most popular one is a simple timeout mechanism, in which a request for a resource lock doesn’t block indefinitely, but only for up to some time limit. A more advanced mechanism requires the lock request that is about to enter a wait-state to first search the lock database to determine that its wait state will not establish a deadlock.

The way rollback is facilitated is by establishing the beginning and end of each transaction. At a transaction start the file system (or database) records the current state of files (or tables), which is considered a valid state, and records activities of the user/process that might change that state. If rollback is initiated, these activities can be reversed, and the original valid state can be restored. If the transaction is completed successfully, the records of the original state and the modifying actions can be discarded. Releasing incremental locks, possibly interwoven with partial updates, requires a careful and complex process, and it is the complexity of the rollback operation that gives true deadlock detection an advantage over simple timeout (Article “Cobol: Not Dead Yet” by Robert Mitchell).

Prominent TP-related syntax components of the new COBOL extensions to the SELECT file-control entry, the OPEN statement, and other I-O statements include: (Article “Cobol Coders: Going, Going, Gone?” by Gary Anthes)

[LOCK MODE IS { MANUAL | AUTOMATIC }
[ WITH LOCK ON [ MULTIPLE { RECORD | RECORDS }
[ SHARING WITH { ALL OTHER | NO OTHER | READ ONLY }
[ RETRY { numeric TIMES | numeric SECONDS | FOREVER }
[ WITH [ NO ] LOCK ]
READ …. [ { ADVANCING ON | IGNORING } LOCK ]
UNLOCK file-name [ RECORD | RECORDS ]
Automated Formatting

Automated formatting is an important technique for the software maintainer. It is either applied separately to improve the readability of source code, or as part of a source code transformation tool chain. In an industrial setting automated formatters need to be tailored to the requirements of the customer. The (legacy) programming language or dialect and the corporate formatting conventions are specific and non-negotiable.

Driven by an industrial case of nearly 80 thousand lines of Cobol code, several limitations in existing formatting technology have been addressed. With its improved flexibility by replacing a generative phase by a generic tool, and added a little expressiveness to the formatting back end. Most importantly, it employed a multi-stage formatting framework that can cope with any kind of formatting convention using more computational power.

COBOL 2002 Core capabilities

Object orientation support. Object-oriented programming is supported, similar to C++ and Java. The productivity of COBOL applications can be improved by using universal object-oriented methods such as inheritance, polymorphism, and encapsulation.

Common exception handling. In addition to the USE statement for conventional I/O error processing, various other processing routines for handling cases such as data exceptions and numeric size overflow can be specified. Various execution error handling routines that used to form a large part of COBOL applications can be separated from the logic part of application itself, thereby improving logic readability.

User-defined data types. Data types data can be declared. You can freely define and reference data types and easily code data items with the same structure.

USER-defined functions. In addition to using the intrinsic function provided by COBOL, you can also define your own functions in formulas results in simple and highly readable applications.

Free-form reference format. In addition to the conventional fixed format, a free-form reference format without sequence number and indicator areas is also available. This enables coding in a free format without having to be aware of column positions.

Compiler directives. When compiling COBOL source code, special instructions can be given to the compiler to control its behavior and the interpretation of statements. This is convenient for managing all descriptions of platform-specific procedures or procedures customized for individual users in one source program.

JAVA-COBOL interoperability. A Java application (Servlet or JSP) running in the Cosminexus environment can call a COBOL program as a JavaBeans instance. A COBOL accessBeam (JavaBeans) for calling the COBOL application is created automatically by COBOL2002 development environment product, which helps in streamlining development tasks. By using JAVA and COBOL in tandern, system can be constructed quickly.

XML data handling. XML data can be processed and records in COBOL programs. COBOL programming know-how is sufficient to develop XML data processing applications. Depending on the application processing, the required range for XML data (arbitrary XML element) can be matched to COBOL records.

COBOL-SOAP interoperability. This feature provides environments for Web service application development and operation. It reduces the need of creating complex routines for communication processing and enables efficient service development using COBOL. Both the server and client applications of Web services can be developed with COBOL.

Resources:

Sammet, J.E. (1981). “The Early History of COBOL.” In History of Programming Languages, by Wexelblat, R.L., ed. New York: ACM Monograph Series.

Future of COBOL 5. LegacyJ Corporation (2003). Retrieved on 2006-11-08.

M.G.J. Van den Brand, A.T. Kooiker, J.J. Vinju, N.P. Veerman, “A Language Independent Framework for Context-sensitive Formatting,” csmr, pp. 103-112,  Conference on Software Maintenance and Reengineering (CSMR’06),  2006.

J;C Migrations, JCM News, October 2003 edition, Website: http://www.jcmigrations.com/news5.htm

Garfunkel, Jerome [1987]. “Caesarean Birth of COBOL 85”, The COBOL 85 Example Book. United States and Canada: John Wiley ; Sons. ISBN 0-471-80461-4.

Cobol Standards Committee, by Micro Focus, website: http://www.cobolstandards.com/

The COBOL2002 Family (2006) by Hitachi Ltd. Japan, An advanced and Reliable Foundation for Further Progress, Website:

http://www.hitachi.co.jp/Prod/comp/soft1/global



Leave a Reply

Your email address will not be published.

*
*
*

x

Hi!
I'm Beba

Would you like to get such a paper? How about receiving a customized one?

Check it out