COBOL

COBOL

base data
developers:
Current version: ()
Operating system: z/OS, Windows, Linux, Mac OS X, BS2000 uvm.
Category:
License:
German-language: no
Website:

COBOL is a programming language, like FORTRAN infor the early period of the computer development 1960 developed and until today one uses. The style of this programming language is word-rich and strongly ajar against the natural speech.

The abbreviation COBOL stands for B forCO mmon usiness O riented L anguage ".

Table of contents

to 4.4 international standardisation

with

ISO 4,5 from the urgent desire to have an hardware-independent standardized problem oriented language for the production of programs for the economical range.The programming of commercial applications differs from technical-industrial applications by the handling of large data sets instead of the execution of extensive computations. After the programming of technical-industrial applications had been already highly simplified by FORTRAN, the new programming language should by intensified consideration of commercial problem definitions,reach in particular the handling of large data sets and of its input and output, this also for commercial applications, which were programmed to a large extent up to then in assembler languages. A working group used by the American Department of Defense developed a standard from the grinding of the programming languages at that time FLOW MATIC by SPERRY Univac (Remington-Rand), Commercial translator (COMTRAN) by IBM and FACT von Minneapolis Honeywell. Hieran Mrs. Grace M. was in particular involved. Hopper.

The result was adopted 1960 as COBOL-60 of CODASYL, developed further in the future and of national and internationalInstitutes for standardisation (ANSI, ISO) standardizes.

COBOL found fast the way into the civilian use as one the first commercially used compilable and to today furthest common programming languages, particularly for commercial applications.

language syntax

COBOL is characterisedby a strict separation from data declaration and procedural instructions. In the procedure division one can use only variables, which were defined before in the data division. Also the appearance of formatted expenditures is specified not in the procedure division, but in the data division by the picture clause.The “REPORT WRITER” makes it possible, the structure of a pressure list completely in the data division as physical structure on the part of to describe and logical structure of item lines with group totals etc. without that must worry procedure division about it.

A COBOL program is inParts (DIVISION), chapter (SECTION) and sections (PARAGRAPH) arranged. The four division are in their fixed order:

  • And to a large extent obsoleten paragraph for comments unites identification division with the program name;
  • Environment division, where interfaces are defined to the operating and its file system;
  • DATA division with the definition of the program variables and data structures
  • Procedure division with the procedural instructions.

In the IDENTIFICATION DIVISION does not give it sections, and in the PROCEDURE DIVISION recently SECTIONS and also paragraph can be void. ENVIRONMENT and DATA division can and. And. are void completely.

The traditional coding pattern with COBOL corresponds to the punch card with its 80 columns, D. h. Character positions. Reserve

  • the first 6 places for line numberings column
  • 7 were for the marking of a comment or of a continuation line or a one, thoseonly for debugging to be translated is
  • column 8 to 11 (AREA A) for the names of division, sections and paragraph
  • column 12 to 72 (AREA B) for all remaining, z. B. Statement
  • column 73 to 80 for other markings howz. B. the names of program or SOURCE element.

The current standard (2002) knows a fixed line format, which waive the organization into AREA A and AREA B, as well as a completely free format, which permit 1 to 255 everything in the columns.The special role of the column 7 is void here:

  • Kommentare werden hier mit *> introduced.
  • Continuation lines by means of & compound stringers replaces
  • Debuggingzeilen können mittels bedingter Übersetzung realisiert werden: >>DEFINE ... >> IF…

Originally COBOL was written only in capital letters (one had only punch cards and line printers without small letters), today can variables and instructions for COBOL of any size orsmall to be written. The language is not case sensitive:

A nearly minimum COBOL program:

       Identification division.
       Program ID. HALLOPGM.
       Procedure division.
           Display “hello Wikipedianer!”          GOBACK.   

data declarations

… take place in the DATA division

  • files and their sentence structures become inthe file described section.
  • [أربيتسفريبل] [وردن] في [در] [ووركينغ-ستورج سكأيشن] [أوند] [در] [لوكل-ستورج] قسم [دفينيرت].
  • Call parameters are defined in the Linkage section.
  • Complex pressure lists are defined in the report section.
  • Screen in and expenditure in the screen section.

To the declarationfrom variables COBOL offers numerous clauses, the their most important level number, the picture clause and the USAGE clause is.

The level number 77 marks a free standing variable, 01 can likewise a free standing variable designate, the declaration of a group however normally introduces, which inother languages than record (Pascal and. A.) or struct ([[C++]], C and. A. is designated). The level numbers 02 to 49 mark then this group subordinated data declarations, which can be also again groups (records). A data declaration, no furthersubordinated (with higher level numbers) data declarations has, in COBOL as elementary (elementary Item) one designates, otherwise it is a group variable (Group Item). One can represent such a group abstractly as a tree with the groups as knots andelementary the Items as sheets.

With the special level number 66 one can give another name to whole storage areas, define with 88 a condition name, like a boolean expression in z. B. an IF instruction related will can.

The level numbers become usuallyin two digits written. From the punch card times the habit originates not to assign the level numbers in a group definition again sequentially, but in steps from 5 or 10 to because one could insert then intermediate stages, without directly a whole card deck to punch to have.

Thatthe following example describes the layout of the traditional 80-digit COBOL program line:

01 COBOL line USAGE DISPLAY. 05 line number SPADES 9 (6). 05 indicator SPADES X. 88 actual comment VALUES “*” “/”. 88 actual continuation line VALUE “-”. 88 actual debugging line VALUE “D”. “D”. 05 range A AND b. 10 range A SPADESX (4). 10 range b SPADES X (61). 05 line end identification SPADES X (8).

The definition of a range of values looks as example in such a way:

01 range of values SPADES 99V99 USAGE COMPutational. 88 a values VALUE 1 thru 9. 88 Zehnerwerte VALUE 10 thru 19. 88 twenties-values VALUE 20thru 29.

Outside feature and internal representation are essentially determined by the clauses PICTURE and USAGE. USAGE COMP, if on it is to be counted, DISPLAY to the announcement. The symbols behind PICture specify the number of places or indications, and/or. Editing symbolslike decimal or rope the separators, signs, currency symbols, meant decimal separator (V) etc., and determine an elementary variable thereby as either alphabetically, alphanumerically, numerically or numeric-edit.

In COBOL formatting for visible expenditure is settled evenly by the data declaration, not by procedural instructionsas in languages such as Pascal or C. Altogether about 60 possible clauses of a data declaration one may look up the remainder that in a COBOL manual.

procedural instructions

in the Procedure Divsion the executable program code is. The execution beginswith the first instruction in behind the heading Procedure division and/or. that DECLARATIVES, whose execution is released only by certain events. Afterwards all instructions are sequentially implemented, until a STOP RUN terminates the program, or a GO TON tooanother place in the program branches out.

The Procedure Divsion consists of one or more procedures. A procedure is either

  • a section: A name, that in column 8 begins followed from the keyword SECTION and one point.
  • a group of sections
  • a paragraph: A name, which begins in column 8 and ends with point.
  • a group of paragraph

such a procedure consists then of one or more instructions for COBOL (statements).

Procedures can be implemented with the instruction for COBOL Perform. It givesno formal parameter transfer, all procedures have access to all fields in the DATA division.

By means of CALL external programs (COBOL or other programming languages) can be called. Parameters By are handed over Reference or By content.

COBOL supports structured programming;the use of the likewise permissible GOTOs is today verpönt. In professional programming in-house programming standards, those prevail specify then in the majority that procedures consist exclusively of a section.

A goal of the COBOL syntax is to be that also not onformal programming syntax used humans the sense COBOL program to suspect can (if it or it something English can). All instructions for COBOL begin with a verb and of it give it many.

simple code chips

for the representation of the syntax simple becomes C (or Java) taken to assistance.

  • An A = b; MOVE is b TON of A in COBOL.
  • If it e.g. in C A = b is called + C;, then a COBOL programmer writes either ADD b ton CGIVING A or alternatively COMPUTE A = b + C.
  • A++; in C ADD corresponds to 1 TON of A. on COBOL.

IF/ELSE and EVALUATE

IF and ELSE function in such a way, as one expects it. The end If becameonly with the COBOL85-Standard imported. In the COBOL74-Standard the IF instruction was terminated still by one point, which could represent a source of error which can be ignored easily.

COBOL85-Syntax:

   If Nenner >0 Compute number = counter/denominator Else display “I are so unfortunate!” Move 0 tonsNumber of end If

COBOL74-Syntax:

   If Nenner > 0       Compute number = counter/denominator  Else       Display “I is so unfortunate!”       Move 0 tons of number.

EVALUATE makes the repeated definition by cases, with which each form of CASE or SWITCH (as in C), consequences from IF/ELSIF/ELSIF/END IF toto complete decision tables to be represented can. The instruction EVALUATE was integrated for the first time in COBOL85, COBOL versions before the 85-Version knows no EVALUATE, so that there repeated definitions by cases over had to be illustrated the one which can be read - IF-Konstrukte partly with difficulty.

   Evaluate True
       When  Nenner >0 Compute number= counters/denominator When denominator  < 0 Compute number = counter/denominator * -1 When OTHER display “I are already again unfortunate!” Move 0 tons of counters end Evaluate

a COBOL speciality are the so-called Conditional statement, that are instructions for COBOLwith a condition clause:

COBOL85-Syntax:

   READ input record       To RK end           Display “file end reaches” input counters “read!”            Set end the processing ton of True       To emergency RK end           ADD 1 ton of input counters  END READ

loops

a C-loop as „for (i=0; i< 10; i++) {…}“one codes in COBOL with PERFORM (COBOL85-Syntax):

   Perform Varying i From 1 By 1            Until i  > 10     . . .
   END by form

COBOL today

the main operational area of the programming language COBOL is the operational data processing. If EDP programmes ina user interface, procedure division and a data retention part to be structured, lies the employment use of COBOL programs in the procedure division.

In particular on PCs in addition, on other systems can come than user interface a multiplicity from possibilities to the employment. Apart from the standard COBOL instructions ACCEPT forKeyboard entry and DISPLAY to the display output the SCREEN SECTION is added from the X/OPEN specification. In addition compiler-manufacturer-specific and compiler-producer-independent GUI solutions. Also Internet Browser interfaces are possible - or for Java or under Windows also Visual basic programs.

The data retention part can with COBOL means or with a data base connectionare realized.

COBOL is oriented (on large computers) at batch processing and contains z. B. with ACCEPT/DISPLAY only simple elements, in order to program interactive/expenditure at a terminal or a PC. COBOL nevertheless plays problem-free a large role as programming language with the productionof on-line systems such as CICS or CIM; such transaction monitors make their services available with a COBOL-suited API : Either like z. B. with CIM as pure call interface (CALL “CBLTDLI”) or as with CICS as EXEC language, those of a pre-processor inCOBOL code is converted.

The same applies to the access to relational data bases: COBOL programs use then embedded SQL (EXEC SQL). Also one can program Stored Procedures in COBOL.

Innovations in COBOL from the recent time:

  • Nested Program permit it, within oneTo write COBOL program procedures with local variables.
  • Intrinsic of transmitting ion for mathematical and other functions.
  • Recursion with external calls is possible.
  • The COBOL verb XML PARSE offers an integrated XML - to Parser.
  • OO-extensions facilitated co-operation with object-oriented programming humans and their programs.

Altogether it can be said that with the programming language COBOL much goes and with reinforcement through transaction systems and small auxiliary routines into C or assembler so quite everything.

development and standardisation

a committee of the CODASYL mentioned above compiled inYear 1959 some principles, specified the name COBOL, and published in April 1960 its final report with the first specifications of the programming language, which entered as COBOL-60 history.

In the context of CODASYL there was then constantly a committee, partlywith subs-committee, that and/or. with the advancement of COBOL and in the course of the decades different names and different status were concerned within CODASYL had.

development by CODASYL

COBOL-60 showed the practicability of the common programming language desired.

COBOL-61 was only partly compatibly with the previous version, in numerous compilers was implemented however to a large extent. CODASYL committed itself then to develop the language further from there evolutionary too instead of making revolutionary changes.

With COBOL-61 EXTENDED came and. A. thoseSORT possibilities and the REPORT WRITER in addition.

COBOL, EDITION 1965 added and. A. internal tables and options for file handling in addition.

Further documents for development are the CODASYL COBOL JOURNAL OF DEVELOPMENT of the years 1968, 1969, 1970, 1973, 1976, 1978, 1981 and1984.

extensions by X/Open, which became open

Group in the context of the efforts around a standard for the operating system Unix by the industrial combination X/Open for it also specifications for COBOL agreed upon, their youngest of 1991 from the highestStages of the prescribed modules of COBOL-85 exists, with the extension of 1989 by the “Intrinsic of transmitting ion”, but without report Writer, segmenting and debugging, for it however with own extensions for interaction with diplay forms (SCREEN SECTION and ACCEPT/DISPLAY), common access to files alsoBarriers on files and sentences, as well as internationalization with z. B. Double-byte character sets.

standardisation by ANSI

in the year 1960 became lively, by the trade association “computer and Business equipment Manufacturers Association” in the context of the US-American standardisation organization ( ASP) in“Committee on of computer and information processing” with the number X3, production, which furnished then a sub-committee X3.4 for programming languages, which furnished again a sub-committee X3.3.4 for COBOL. In December 1962 manufacturers and other interested one became the cooperation at the standardisationinvited, whereby it was then specified that the standardisation on the publications of the CODASYL should be based.

The first standard became to 23. August 1968 as the USA standard COBOL 1968 discharged and as document X3.23-1968 publishes.

The committee X3.4.4 became thenTechnical committee X3J4, as he is still called also today, and started working to develop the next standard then to 10. May 1974 as American national standard COBOL 1974 discharged and then in the document TO the X3.23-1974 publishesbecame.

The next standard was adopted in April 1985 by X3J4 and accepted in September by the responsible decision-making body that in the meantime ANSI being called organization and published then as TO the X3.23-1985. COBOL-85 led the possibility for the first time with limiters such as END-IF and END BY FORM, in COBOL at will decision (IF, EVALUATE) and repetitive instructions (PERFORM) geschachtelte to write and thus the so-called. “Programming “structured in COBOL to practice. COBOL-85 an additive with inserted (intrisic) functions and a further with corrections became laterto the standard publishes.

The current standard was adopted 2002. Substantial changes therein are the assumption of the extensions by X/Open, the explicit support compiling conditioned by international character sets including university University of , object-oriented programming as well as, beside numerous other extensions and specifying.

After the end of CODASYL the committee J4 took also the responsibility not only for the standardisation, but also for the development.

The next standard is prepared for the year 2008.

international standardisation with ISO

thatCommittee X3J4 (lead X3.4.4) co-operated from the outset closely with different international committees. Agreed corresponding TO the COBOL X3.23-1968 with the ISO recommendation for COBOL.

In the ISO the Technical Committee ISO/TC 97, computer and information processing is responsible, itsSecretariat is placed by the ANSI.

ISO has a recommendation (Recommendation) regarding COBOL R-1989: 1972, as well as standard ISO 1989:1978 and ISO 1989:1985, and the default of the US standardisation committee discharges taken over.

The current standard 2002 is in reverse first published as ISO/CInternational Electronical Commission 1989:2002 andthen taken over by the national standard organizations.

modules and standard-conformal implementations

COBOL-68, COBOL-74 and COBOL-85 assigned the different features of the language to a module with in each case one to three “levels”, from which then minimum and full implementations of theStandards as combination of certain levels of the respective modules were defined. An implementation conformal with COBOL-2002 must implement the entire language scope.

COBOL compilers

for computers of the classes „large computers “and „middle data processing technology “offered and offer their respective manufacturer -IBM, Unisys, Siemens, HP, bulletin and. A. - on their prop. guessing eras of operating systems cut COBOL compilers on, z. T. different compilers, which correspond to for example different standards.

For operating systems, from the UNIX and/or. , Gives it COBOL compiler of different software producers developed for MS-DOS tradition.Details see in the COBOL FAQ von William M. linked down. Small.

Web on the left of

Wiktionary: COBOL - Word origin, synonyms and translations
 

  > German to English > de.wikipedia.org (Machine translated into English)