Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

COBOL

From Wikipedia, the free encyclopedia
Programming language with English-like syntax

COBOL
TheCOBOL 60 report toCODASYL (April 1960)
ParadigmProcedural,imperative,object-oriented,generic
Designed byHoward Bromberg,Norman Discount,Vernon Reeves,Jean E. Sammet,William Selden,Gertrude Tierney, with indirect influence fromGrace Hopper[1]
DevelopersCODASYL,ANSI,ISO/IEC
First appeared1959; 66 years ago (1959)
Stable release
ISO/IEC 1989:2023 / 2023
Typing disciplineWeak,static
Filename extensions.cbl,.cob,.cpy
Majorimplementations
GnuCOBOL,IBM COBOL,Micro Focus Visual COBOL
Dialects
COBOL/2, DEC COBOL-10, DEC PDP-11 COBOL, DEC PDP-11 COBOL-85, DEC VAX COBOL, DOSVS COBOL, Envyr ICOBOL, Fujitsu COBOL, Hitachi COBOL2002, HP3000 COBOL/II, IBM COBOL SAA, IBM COBOL/400, IBM COBOL/II, IBM Enterprise COBOL, IBM ILE COBOL, IBM OS/VS COBOL, ICL COBOL (VME), Micro Focus ACUCOBOL-GT, Micro Focus COBOL-IT, Micro Focus RM/COBOL, Micro Focus Visual COBOL, Microsoft COBOL, Raincode COBOL, Realia COBOL, Ryan McFarland RM/COBOL, Ryan McFarland RM/COBOL-85, Tandem (NonStop) COBOL, Tandem (NonStop) SCOBOL, UNIVAC COBOL, Unisys MCP COBOL74, Unisys MCP COBOL85,X/Open COBOL,[2] Veryant isCOBOL, Wang VS COBOL,WATBOL
Influenced by
Initial:AIMACO,COMTRAN,FACT,FLOW-MATIC
COBOL 2002:[a]C++,Eiffel,Smalltalk
Influenced
CobolScript,[6]EGL,[7]PL/I,[8]PL/B[9]

COBOL (/ˈkbɒl,-bɔːl/; anacronym for "common business-oriented language") is acompiled English-likecomputer programming language designed for business use. It is animperative,procedural, and, since 2002,object-oriented language. COBOL is primarily used in business, finance, and administrative systems for companies and governments. COBOL is still widely used in applications deployed onmainframe computers, such as large-scalebatch andtransaction processing jobs. Many large financial institutions were developing new systems in the language as late as 2006,[10] but most programming in COBOL today is purely to maintain existing applications. Programs are being moved to new platforms, rewritten in modern languages, or replaced with other software.[11]

COBOL was designed in 1959 byCODASYL and was partly based on the programming languageFLOW-MATIC, designed byGrace Hopper. It was created as part of aU.S. Department of Defense effort to create aportable programming language for data processing. It was originally seen as a stopgap, but the Defense Department promptly pressured computer manufacturers to provide it, resulting in its widespread adoption.[12] It wasstandardized in 1968 and has been revised five times. Expansions include support forstructured andobject-oriented programming. The current standard isISO/IEC 1989:2023.[13]

COBOL statements haveprose syntax such asMOVExTOy, which was designed to be self-documenting and highly readable. However, it is verbose and uses over 300reserved words compared to the succinct and mathematically inspired syntax of other languages.

The COBOL code is split into fourdivisions (identification, environment, data, and procedure), containing a rigid hierarchy of sections, paragraphs, and sentences. Lacking a largestandard library, the standard specifies 43 statements, 87 functions, and just one class.

COBOL has beencriticized for its verbosity, design process, and poor support forstructured programming. These weaknesses result in monolithic programs that are hard to comprehend as a whole, despite their local readability.

For years, COBOL has been assumed as a programming language for business operations in mainframes,[14] although in recent years, many COBOL operations have been moved tocloud computing.[15]

History and specification

[edit]
Timeline of COBOL language
YearInformal nameOfficial Standard
1960COBOL-60
1961COBOL-61
1963COBOL-61 Extended
1965COBOL-65
1968COBOL-68ANSI INCITS X3.23-1968
1974COBOL-74ANSI INCITS X3.23-1974
1985COBOL-85ANSI INCITS X3.23-1985
ISO/IEC 1989:1985
2002COBOL-2002ISO/IEC 1989:2002
2014COBOL-2014ISO/IEC 1989:2014
2023COBOL-2023ISO/IEC 1989:2023

Background

[edit]

In the late 1950s, computer users and manufacturers were becoming concerned about the rising cost of programming. A 1959 survey had found that in any data processing installation, the programming cost US$800,000 on average and that translating programs to run on new hardware would cost US$600,000. At a time when newprogramming languages were proliferating, the same survey suggested that if a common business-oriented language were used, conversion would be far cheaper and faster.[16]

On 8 April 1959,Mary K. Hawes, a computer scientist atBurroughs Corporation, called a meeting of representatives from academia, computer users, and manufacturers at theUniversity of Pennsylvania to organize a formal meeting on common business languages.[17] Representatives includedGrace Hopper (inventor of the English-like data processing languageFLOW-MATIC),Jean Sammet, andSaul Gorn.[18][19]

At the April meeting, the group asked theDepartment of Defense (DoD) to sponsor an effort to create a common business language. The delegation impressed Charles A. Phillips, director of the Data System Research Staff at the DoD,[20] who thought that they "thoroughly understood" the DoD's problems. The DoD operated 225 computers, had 175 more on order, and had spent over $200 million on implementing programs to run on them. Portable programs would save time, reduce costs, and ease modernization.[21]

Charles Phillips agreed to sponsor the meeting, and tasked the delegation with drafting the agenda.[22]

COBOL 60

[edit]

On 28 and 29 May 1959 (exactly one year after the ZürichALGOL 58 meeting), a meeting was held atthe Pentagon to discuss the creation of a common programming language for business. It was attended by 41 people and was chaired by Phillips.[23] The Department of Defense was concerned about whether it could run the same data processing programs on different computers.FORTRAN, the only mainstream language at the time, lacked the features needed to write such programs.[24]

Representatives enthusiastically described a language that could work in a wide variety of environments, from banking and insurance to utilities and inventory control. They agreed unanimously that more people should be able to program and that the new language should not be restricted by the limitations of contemporary technology. A majority agreed that the language should make maximal use of English, be capable of change, be machine-independent, and be easy to use, even at the expense of power.[25]

The meeting resulted in the creation of asteering committee and short, intermediate, and long-range committees. The short-range committee was given until September (three months) to produce specifications for an interim language, which would then be improved upon by the other committees.[26][27] Their official mission, however, was to identify the strengths and weaknesses of existing programming languages; it did not explicitly direct them to create a new language.[24]

The deadline was met with disbelief by the short-range committee.[28] One member,Betty Holberton, described the three-month deadline as "gross optimism" and doubted that the language really would be a stopgap.[29]

The steering committee met on 4 June and agreed to name the entire activity theCommittee on Data Systems Languages, orCODASYL, and to form an executive committee.[30]

The short-range committee members represented six computer manufacturers and three government agencies. The computer manufacturers wereBurroughs Corporation,IBM,Minneapolis-Honeywell (Honeywell Labs),RCA,Sperry Rand, andSylvania Electric Products. The government agencies were theU.S. Air Force, the Navy'sDavid Taylor Model Basin, and theNational Bureau of Standards (now the National Institute of Standards and Technology).[31] The committee was chaired byJoseph Wegstein of the U.S. National Bureau of Standards. Work began by investigating data descriptions, statements, existing applications, and user experiences.[32]

The committee mainly examined theFLOW-MATIC,AIMACO, andCOMTRAN programming languages.[24][33] The FLOW-MATIC language was particularly influential because it had been implemented and because AIMACO was a derivative of it with only minor changes.[34][35] FLOW-MATIC's inventor, Grace Hopper, also served as a technical adviser to the committee.[28] FLOW-MATIC's major contributions to COBOL were long variable names, English words for commands, and the separation of data descriptions and instructions.[36]

Hopper is sometimes called "the mother of COBOL" or "the grandmother of COBOL",[37][38][39] althoughJean Sammet, a lead designer of COBOL, said Hopper "was not the mother, creator, or developer of Cobol."[40][1]

IBM's COMTRAN language, invented byBob Bemer, was regarded as a competitor to FLOW-MATIC[41][42] by a short-range committee made up of colleagues of Grace Hopper.[43] Some of its features were not incorporated into COBOL so that it would not look like IBM had dominated the design process,[26] and Jean Sammet said in 1981 that there had been a "strong anti-IBM bias" from some committee members (herself included).[44] In one case, after Roy Goldfinger, author of the COMTRAN manual and intermediate-range committee member, attended a subcommittee meeting to support his language and encourage the use of algebraic expressions, Grace Hopper sent a memo to the short-range committee reiterating Sperry Rand's efforts to create a language based on English.[45]

In 1980, Grace Hopper commented that "COBOL 60 is 95% FLOW-MATIC" and that COMTRAN had had an "extremely small" influence. Furthermore, she said that she would claim that work was influenced by both FLOW-MATIC and COMTRAN only to "keep other people happy [so they] wouldn't try to knock us out.".[46]

Features from COMTRAN incorporated into COBOL included formulas,[47] thePICTURE clause,[48] an improvedIF statement, which obviated the need forGO TOs, and a more robust file management system.[41]

The usefulness of the committee's work was a subject of great debate. While some members thought the language had too many compromises and was the result ofdesign by committee, others felt it was better than the three languages examined. Some felt the language was too complex; others, too simple.[49]

Controversial features included those some considered useless or too advanced for data processing users. Such features includedBoolean expressions,formulas, and tablesubscripts (indices).[50][51] Another point of controversy was whether to make keywords context-sensitive and the effect that would have on readability.[50] Although context-sensitive keywords were rejected, the approach was later used inPL/I and partially in COBOL from 2002.[52] Little consideration was given tointeractivity, interaction withoperating systems (few existed at that time), and functions (thought of as purely mathematical and of no use in data processing).[53][54]

The specifications were presented to the executive committee on 4 September. They fell short of expectations: Joseph Wegstein noted that "it contains rough spots and requires some additions," and Bob Bemer later described them as a "hodgepodge." The committee was given until December to improve it.[28]

At a mid-September meeting, the committee discussed the new language's name. Suggestions included "BUSY" (Business System), "INFOSYL" (Information System Language), and "COCOSYL" (Common Computer Systems Language).[55] It is unclear who coined the name "COBOL",[56][57] although Bob Bemer later claimed it had been his suggestion.[58][59][60]

In October, the intermediate-range committee received copies of theFACT language specification created byRoy Nutt. Its features impressed the committee so much that they passed a resolution to base COBOL on it.[61]

This was a blow to the short-range committee, who had made good progress on the specification. Despite being technically superior, FACT had not been created with portability in mind or through manufacturer and user consensus. It also lacked a demonstrable implementation,[28] allowing supporters of a FLOW-MATIC-based COBOL to overturn the resolution. RCA representative Howard Bromberg also blocked FACT, so that RCA's work on a COBOL implementation would not go to waste.[62]

It soon became apparent that the committee was too large to make any further progress quickly. A frustrated Howard Bromberg bought a $15 tombstone with "COBOL" engraved on it and sent it to Charles Phillips to demonstrate his displeasure.[b][64][65]

A subcommittee was formed to analyze existing languages and was made up of six individuals:[24][66]

  • William Selden and Gertrude Tierney of IBM,
  • Howard Bromberg and Howard Discount of RCA,
  • Vernon Reeves andJean E. Sammet of Sylvania Electric Products.

The subcommittee did most of the work creating the specification, leaving the short-range committee to review and modify their work before producing the finished specification.[24]

The specifications were approved by the executive committee on 8 January 1960, and sent to the government printing office, which printed them asCOBOL 60. The language's stated objectives were to allow efficient, portable programs to be easily written, to allow users to move to new systems with minimal effort and cost, and to be suitable for inexperienced programmers.[67]

The CODASYL Executive Committee later created the COBOL Maintenance Committee to answer questions from users and vendors and to improve and expand the specifications.[68]

During 1960, the list of manufacturers planning to build COBOL compilers grew. By September, five more manufacturers had joined CODASYL (Bendix,Control Data Corporation,General Electric (GE),National Cash Register, andPhilco), and all represented manufacturers had announced COBOL compilers. GE and IBM planned to integrate COBOL into their own languages, GECOM and COMTRAN, respectively. In contrast,International Computers and Tabulators planned to replace their language, CODEL, with COBOL.[69]

Meanwhile, RCA and Sperry Rand worked on creating COBOL compilers. The first COBOL program ran on 17 August on an RCA 501.[70] On 6 and 7 December, the same COBOL program (albeit with minor changes) ran on an RCA computer and a Remington-RandUnivac computer, demonstrating that compatibility could be achieved.[71]

The relative influence of the languages that were used is still indicated in the recommended advisory printed in all COBOL reference manuals:

COBOL is an industry language and is not the property of any company or group of companies, or of any organization or group of organizations.

No warranty, expressed or implied, is made by any contributor or by the CODASYL COBOL Committee as to the accuracy and functioning of theprogramming system and language. Moreover, no responsibility is assumed by any contributor or by the committee in connection therewith. The authors and copyright holders of the copyrighted material used herein are as follows:

FLOW-MATIC (trademark ofUnisys Corporation), Programming for the UNIVAC (R) I and II, Data Automation Systems, copyrighted 1958, 1959, by Unisys Corporation; IBM Commercial Translator Form No. F28-8013, copyrighted 1959 by IBM; FACT, DSI 27A5260-2760, copyrighted 1960 by Minneapolis-Honeywell.

They have specifically authorized the use of this material, in whole or in part, in the COBOL specifications. Such authorization extends to the reproduction and use of COBOL specifications in programming manuals or similar publications.[72]

COBOL-61 to COBOL-65

[edit]

It is rather unlikely that Cobol will be around by the end of the decade.

Anonymous, June 1960[73]

Many logical flaws were found inCOBOL 60, leading General Electric'sCharles Katz to warn that it could not be interpreted unambiguously. A reluctant short-term committee performed a total cleanup, and, by March 1963, it was reported that COBOL's syntax was as definable asALGOL's, although semantic ambiguities remained.[69]

COBOL is a difficult language to write a compiler for, due to the large syntax and many optional elements within syntactic constructs, as well as the need to generate efficient code for a language with many possible data representations, implicit type conversions, and necessary set-ups for I/O operations.[74] Early COBOL compilers were primitive and slow. A 1962 US Navy evaluation found compilation speeds of 3–11 statements per minute. By mid-1964, they had increased to 11–1000 statements per minute. It was observed that increasing memory would drastically increase speed and that compilation costs varied wildly: costs per statement were between $0.23 and $18.91.[75]

In late 1962, IBM announced that COBOL would be their primary development language and that development of COMTRAN would cease.[75]

The COBOL specification was revised three times in the five years after its publication. COBOL-60 was replaced in 1961 by COBOL-61. This was then replaced by the COBOL-61 Extended specifications in 1963, which introduced the sort and report writer facilities.[76] The added facilities corrected flaws identified by Honeywell in late 1959 in a letter to the short-range committee.[70] COBOL Edition 1965 brought further clarifications to the specifications and introduced facilities for handlingmass storage files andtables.[77]

COBOL-68

[edit]

Efforts began to standardize COBOL to overcome incompatibilities between versions. In late 1962, both ISO and the United States of America Standards Institute (nowANSI) formed groups to create standards. ANSI producedUSA Standard COBOL X3.23 in August 1968, which became the cornerstone for later versions.[78] This version was known as American National Standard (ANS) COBOL and was adopted by ISO in 1972.[79]

COBOL-74

[edit]

By 1970, COBOL had become the most widely used programming language in the world.[80]

Independently of the ANSI committee, the CODASYL Programming Language Committee was working on improving the language. They described new versions in 1968, 1969, 1970, and 1973, including changes such as new inter-program communication, debugging, and file merging facilities, as well as improved string handling andlibrary inclusion features.[81]

Although CODASYL was independent of the ANSI committee, theCODASYL Journal of Development was used by ANSI to identify features that were popular enough to warrant implementing.[82] The Programming Language Committee also liaised withECMA and the Japanese COBOL Standard committee.[81]

The Programming Language Committee was not well-known, however. The vice president, William Rinehuls, complained that two-thirds of the COBOL community did not know of the committee's existence. It also lacked the funds to make public documents, such as minutes of meetings and change proposals, freely available.[83]

In 1974, ANSI published a revised version of (ANS) COBOL, containing new features such asfile organizations, theDELETE statement[84] and thesegmentation module.[85] Deleted features included theNOTE statement, theEXAMINE statement (which was replaced byINSPECT), and the implementer-defined random access module (which was superseded by the new sequential and relative I/O modules). These made up 44 changes, which rendered existing statements incompatible with the new standard.[86] The report writer was slated to be removed from COBOL but was reinstated before the standard was published.[87][88] ISO later adopted the updated standard in 1978.[79]

COBOL-85

[edit]

In June 1978, work began on revising COBOL-74. The proposed standard (commonly called COBOL-80) differed significantly from the previous one, causing concerns about incompatibility and conversion costs. In January 1981, Joseph T. Brophy, Senior Vice-president of Travelers Insurance, threatened to sue the standard committee because it was notupwards compatible with COBOL-74. Mr. Brophy described previous conversions of their 40-million-line code base as "non-productive" and a "complete waste of our programmer resources".[89] Later that year, theData Processing Management Association (DPMA) said it was "strongly opposed" to the new standard, citing "prohibitive" conversion costs and enhancements that were "forced on the user".[90][91]

During the first public review period, the committee received 2,200 responses, of which 1,700 were negative form letters.[92] Other responses were detailed analyses of the effect COBOL-80 would have on their systems; conversion costs were predicted to be at least 50 cents per line of code. Fewer than a dozen of the responses were in favor of the proposed standard.[93]

ISO TC97-SC5 installed in 1979 the international COBOL Experts Group, on initiative ofWim Ebbinkhuijsen. The group consisted of COBOL experts from many countries, including the United States. Its goal was to achieve mutual understanding and respect between ANSI and the rest of the world with regard to the need of new COBOL features. After three years, ISO changed the status of the group to a formal Working Group:WG 4 COBOL. The group took primary ownership and development of the COBOL standard, where ANSI made most of the proposals.

In 1983, the DPMA withdrew its opposition to the standard, citing the responsiveness of the committee to public concerns. In the same year, a National Bureau of Standards study concluded that the proposed standard would present few problems.[91][94] A year later,DEC released aVAX/VMS COBOL-80, and noted that conversion of COBOL-74 programs posed few problems. The newEVALUATE statement and inlinePERFORM were particularly well received and improved productivity, thanks to simplifiedcontrol flow anddebugging.[95]

The second public review drew another 1,000 (mainly negative) responses, while the last drew just 25, by which time many concerns had been addressed.[91]

In 1985, the ISO Working Group 4 accepted the then-version of the ANSI proposed standard, made several changes and set it as the new ISO standard COBOL 85. It was published in late 1985.

Sixty features were changed or deprecated and 115[96] were added, such as:[97][98]

  • Scope terminators (END-IF,END-PERFORM,END-READ, etc.)
  • Nested subprograms
  • CONTINUE, ano-operation statement
  • EVALUATE, aswitch statement
  • INITIALIZE, a statement that can set groups of data to their default values
  • InlinePERFORM loop bodies – previously, loop bodies had to be specified in a separate procedure
  • Reference modification, which allows access to substrings
  • I/O status codes.

The new standard was adopted by all national standard bodies, including ANSI.[79]

Two amendments followed in 1989 and 1993. The first amendment introduced intrinsic functions and the other provided corrections.[79]

COBOL 2002 and object-oriented COBOL

[edit]

In 1997,Gartner Group estimated that there were a total of 200 billion lines of COBOL in existence, which ran 80% of all business programs.[c][99]

In the early 1990s, work began on addingobject-oriented programming in the next full revision of COBOL. Object-oriented features were taken fromC++ andSmalltalk.[3][4]

The initial estimate was to have this revision completed by 1997, and an ISO Committee Draft (CD) was available by 1997. Some vendors (includingMicro Focus,Fujitsu, andIBM) introduced object-oriented syntax based on drafts of the full revision. The final approved ISO standard was approved and published in late 2002.[100]

Fujitsu/GTSoftware,[101] Micro Focus introduced object-oriented COBOL compilers targeting the.NET Framework.

There were many other new features, many of which had been in theCODASYL COBOL Journal of Development since 1978 and had missed the opportunity to be included in COBOL-85.[102] These other features included:[103][104]

Threecorrigenda were published for the standard: two in 2006 and one in 2009.[105]

COBOL 2014

[edit]

Between 2003 and 2009, three technical reports were produced describingobject finalization,XML processing andcollection classes for COBOL.[105]

COBOL 2002 suffered from poor support: no compilers completely supported the standard. Micro Focus found that it was due to a lack of user demand for the new features and due to the abolition of theNIST test suite, which had been used to test compiler conformance. The standardization process was also found to be slow and under-resourced.[106]

COBOL 2014 includes the following changes:[107]

  • Portable arithmetic results have been replaced byIEEE 754 data types
  • Major features have been made optional, such as theVALIDATE facility, the report writer and the screen-handling facility
  • Method overloading
  • Dynamic capacity tables (a feature dropped from the draft of COBOL 2002)[108]

COBOL 2023

[edit]

The COBOL 2023 standard added a few new features:

There is as yet no known complete implementation of this standard.[citation needed]

Legacy

[edit]

COBOL programs are used globally in governments and businesses and are running on diverse operating systems such asz/OS,z/VSE,VME,Unix,NonStop OS,OpenVMS andWindows. In 1997, theGartner Group reported that 80% of the world's business ran on COBOL with over 200 billion lines of code[c] and 5 billion lines more being written annually.[113]

Near the end of the 20th century, theyear 2000 problem (Y2K) was the focus of significant COBOL programming effort, sometimes by the same programmers who had designed the systems decades before. The particular level of effort required to correct COBOL code has been attributed to the large amount of business-oriented COBOL, as business applications use dates heavily, and to fixed-length data fields.[114] Some studies attribute as much as "24% of Y2K software repair costs to Cobol".[115] After the clean-up effort put into these programs for Y2K, a 2003 survey found that many remained in use.[116] The authors said that the survey data suggest "a gradual decline in the importance of COBOL in application development over the [following] 10 years unless ... integration with other languages and technologies can be adopted".[117]

In 2006 and 2012,Computerworld surveys (of 352 readers) found that over 60% of organizations used COBOL (more thanC++ andVisual Basic .NET) and that for half of those, COBOL was used for the majority of their internal software.[10][118] 36% of managers said they planned to migrate from COBOL, and 25% said that they would do so if not for the expense of rewritinglegacy code. Alternatively, some businesses have migrated their COBOL programs from mainframes to cheaper, faster hardware.[10]

Testimony before theHouse of Representatives in 2016 indicated that COBOL is still in use by many federal agencies.[119]Reuters reported in 2017 that 43% of banking systems still used COBOL with over 220 billion lines of COBOL code in use.[120]

By 2019, the number of COBOL programmers was shrinking fast due to retirements, leading to an impending skills gap in business and government organizations which still use mainframe systems for high-volume transaction processing. Efforts to rewrite systems in newer languages have proven expensive and problematic, as has the outsourcing of code maintenance, thus proposals to train more people in COBOL are advocated.[121]

During theCOVID-19 pandemic and the ensuing surge of unemployment, several US states reported a shortage of skilled COBOL programmers to support the legacy systems used for unemployment benefit management. Many of these systems had been in the process of conversion to more modern programming languages prior to the pandemic, but the process was put on hold.[122] Similarly, the USInternal Revenue Service rushed to patch its COBOL-basedIndividual Master File in order to disburse the tens of millions of payments mandated by theCoronavirus Aid, Relief, and Economic Security Act.[123]

Features

[edit]

Syntax

[edit]

COBOL has an English-like syntax, which is used to describe nearly everything in a program. For example, a condition can be expressed as  xISGREATERTHANy or more concisely as  xGREATERy  or  x>y. More complex conditions can be abbreviated by removing repeated conditions and variables. For example,  a>bANDa>cORa=d  can be shortened toa>bANDcOR=d. To support this syntax, COBOL has over 300keywords.[124][d] Some of the keywords are simple alternative or pluralized spellings of the same word, which provides for more grammatically appropriate statements and clauses; e.g., theIN andOF keywords can be used interchangeably, as canTIME andTIMES, andVALUE andVALUES.

Each COBOL program is made up of four basiclexical items: words, literals, picture character-strings (see§ PICTURE clause) and separators. Words include reserved words and user-defined identifiers. They are up to 31 characters long and may include letters, digits, hyphens and underscores. Literals include numerals (e.g.12) and strings (e.g.'Hello!').[126] Separators include the space character and commas and semi-colons followed by a space.[127]

A COBOL program is split into four divisions: the identification division, the environment division, the data division and the procedure division. The identification division specifies the name and type of the source element and is where classes and interfaces are specified. The environment division specifies any program features that depend on the system running it, such asfiles andcharacter sets. The data division is used to declarevariables andparameters. The procedure division contains the program'sstatements. Each division is sub-divided into sections, which are made up of paragraphs.

Metalanguage

[edit]

COBOL's syntax is usually described with a uniquemetalanguage using braces, brackets, bars and underlining.[128] The metalanguage was developed for the original COBOL specifications.

Elements of COBOL's metalanguage
ElementAppearanceFunction
All capitalsEXAMPLEReserved word
UnderliningEXAMPLEThe reserved word is compulsory
Braces{ }Only one option may be selected
Brackets[]Zero or one options may be selected
Ellipsis...The preceding element may be repeated
Bars{| |}One or more options may be selected. Any option may only be selected once.
[| |]Zero or more options may be selected. Any option may only be selected once.

As an example, consider the following description of anADD statement:

ADD_{identifier-1literal-1}TO_{identifier-2[ROUNDED_]}[|ONSIZE_ERROR_imperative-statement-1NOT_ONSIZE_ERROR_imperative-statement-2|][END-ADD_]{\displaystyle {\begin{array}{l}{\underline {\text{ADD}}}\,{\begin{Bmatrix}{\text{identifier-1}}\\{\text{literal-1}}\end{Bmatrix}}\dots \;{\underline {\text{TO}}}\,\left\{{\text{identifier-2}}\,\left[\,{\underline {\text{ROUNDED}}}\,\right]\right\}\dots \\[1em]\quad \left[\left|{\begin{array}{l}{\text{ON}}\,{\underline {\text{SIZE}}}\,{\underline {\text{ERROR}}}\,{\text{imperative-statement-1}}\\{\underline {\text{NOT}}}\,{\text{ON}}\,{\underline {\text{SIZE}}}\,{\underline {\text{ERROR}}}\,{\text{imperative-statement-2}}\end{array}}\right|\right]\\[1em]\quad \left[\,{\underline {\text{END-ADD}}}\,\right]\end{array}}}

This description permits the following variants:

ADD1TOxADD1,a,bTOxROUNDED,y,zROUNDEDADDa,bTOcONSIZEERRORDISPLAY"Error"END-ADDADDaTObNOTSIZEERRORDISPLAY"No error"ONSIZEERRORDISPLAY"Error"

Code format

[edit]
COBOL program deck of punched cards, from the 1970s
3270 session

The height of COBOL's popularity coincided with the era ofkeypunch machines andpunched cards. The program itself was written onto punched cards, then read in and compiled, and the data fed into the program was sometimes on cards as well.[129]

COBOL can be written in two formats: fixed (the default) or free. In fixed-format, code must be aligned to fit in certain areas (a hold-over from using punched cards). Until COBOL 2002, these were:

NameColumn(s)Usage
Sequence number area1–6Originally used for card/line numbers (facilitating mechanical punched card sorting to assure intended program code sequence after manual editing/handling), this area is ignored by the compiler
Indicator area7The following characters are allowed here:
  • * – Comment line
  • / – Comment line that will be printed on a new page of a source listing
  • - – Continuation line, where words or literals from the previous line are continued
  • D – Line enabled in debugging mode, which is otherwise ignored
Area A8–11This contains:DIVISION,SECTION and procedure headers; 01 and 77 level numbers and file/report descriptors
Area B12–72Any other code not allowed in Area A
Program name area73–Historically up to column 80 for punched cards, it is used to identify the program or sequence the card belongs to

In COBOL 2002, Areas A and B were merged to form the program-text area, which now ends at an implementor-defined column.[130]

COBOL 2002 also introduced free-format code. Free-format code can be placed in any column of the file, as in newer programming languages. Comments are specified using*>, which can be placed anywhere and can also be used in fixed-format source code. Continuation lines are not present, and the>>PAGE directive replaces the/ indicator.[130]

Identification division

[edit]

The identification division identifies the following code entity and contains the definition of a class or interface.

Object-oriented programming

[edit]

Classes andinterfaces have been in COBOL since 2002. Classes have factory objects, containing classmethods and variables, and instance objects, containing instance methods and variables.[131] Inheritance and interfaces providepolymorphism. Support forgeneric programming is provided through parameterized classes, which can be instantiated to use any class or interface. Objects are stored as references which may be restricted to a certain type. There are two ways of calling a method: theINVOKE statement, which acts similarly toCALL, or through inline method invocation, which is analogous to using functions.[132]

*> These are equivalent.INVOKEmy-class"foo"RETURNINGvarMOVEmy-class::"foo"TOvar*> Inline method invocation

COBOL does not provide a way tohide methods. Class data can be hidden, however, by declaring it without aPROPERTY clause, which leaves external code no way to access it.[133]Method overloading was added in COBOL 2014.[134]

Environment division

[edit]

The environment division contains the configuration section and the input-output section. The configuration section is used to specify variable features such as currency signs, locales and character sets. The input-output section contains file-related information.

Files

[edit]

COBOL supports three file formats, ororganizations: sequential, indexed and relative. In sequential files, records are contiguous and must be traversedsequentially, similarly to alinked list. Indexed files have one or more indexes which allow records to berandomly accessed and which can be sorted on them. Each record must have aunique key, but other,alternate, record keys need not be unique. Implementations of indexed files vary between vendors, although common implementations, such asC-ISAM andVSAM, are based on IBM'sISAM. Other implementations areRecord Management Services onOpenVMS andEnscribe onHPE NonStop (Tandem). Relative files, like indexed files, have a unique record key, but they do not have alternate keys. A relative record's key is its ordinal position; for example, the 10th record has a key of 10. This means that creating a record with a key of 5 may require the creation of (empty) preceding records. Relative files also allow for both sequential and random access.[135]

A common non-standard extension is theline sequential organization, used to process text files. Records in a file are terminated by anewline and may be of varying length.[136]

Data division

[edit]

The data division is split into six sections which declare different items: the file section, for file records; the working-storage section, forstatic variables; the local-storage section, forautomatic variables; the linkage section, for parameters and the return value; the report section and the screen section, fortext-based user interfaces.

Aggregated data

[edit]

Data items in COBOL are declared hierarchically through the use of level-numbers which indicate if a data item is part of another. An item with a higher level-number is subordinate to an item with a lower one. Top-level data items, with a level-number of 1, are calledrecords. Items that have subordinate aggregate data are calledgroup items; those that do not are calledelementary items. Level-numbers used to describe standard data items are between 1 and 49.[137][138]

01some-record.*> Aggregate group record item05numPIC 9(10).*> Elementary item05the-date.*> Aggregate (sub)group record item10the-yearPIC 9(4).*> Elementary item10the-monthPIC 99.*> Elementary item10the-dayPIC 99.*> Elementary item

In the above example, elementary itemnum and group itemthe-date are subordinate to the recordsome-record, while elementary itemsthe-year,the-month, andthe-day are part of the group itemthe-date.

Subordinate items can be disambiguated with theIN (orOF) keyword. For example, consider the example code above along with the following example:

01sale-date.05the-yearPIC 9(4).05the-monthPIC 99.05the-dayPIC 99.

The namesthe-year,the-month, andthe-day are ambiguous by themselves, since more than one data item is defined with those names. To specify a particular data item, for instance one of the items contained within thesale-date group, the programmer would usethe-year IN sale-date (or the equivalentthe-year OF sale-date). This syntax is similar to the "dot notation" supported by most contemporary languages.

Other data levels

[edit]

A level-number of 66 is used to declare a re-grouping of previously defined items, irrespective of how those items are structured. This data level, also referred to by the associatedRENAMES clause, is rarely used[139] and, circa 1988, was usually found in old programs. Its ability to ignore the hierarchical and logical structure data meant its use was not recommended and many installations forbade its use.[140]

01customer-record.05cust-keyPIC X(10).05cust-name.10cust-first-namePIC X(30).10cust-last-namePIC X(30).05cust-dobPIC 9(8).05cust-balancePIC 9(7)V99.66cust-personal-detailsRENAMEScust-nameTHRUcust-dob.66cust-all-detailsRENAMEScust-nameTHRUcust-balance.

A 77 level-number indicates the item is stand-alone, and in such situations is equivalent to the level-number 01. For example, the following code declares two 77-level data items,property-name andsales-region, which are non-group data items that are independent of (not subordinate to) any other data items:

77property-namePIC X(80).77sales-regionPIC 9(5).

An 88 level-number declares acondition name (a so-called 88-level) which is true when its parent data item contains one of the values specified in itsVALUE clause.[141] For example, the following code defines two 88-level condition-name items that are true or false depending on the current character data value of thewage-type data item. When the data item contains a value of'H', the condition-namewage-is-hourly is true, whereas when it contains a value of'S' or'Y', the condition-namewage-is-yearly is true. If the data item contains some other value, both of the condition-names are false.

01wage-typePIC X.88wage-is-hourlyVALUE"H".88wage-is-yearlyVALUE"S","Y".

Data types

[edit]

Standard COBOL provides the following data types:[142]

Data typeSample declarationNotes
AlphabeticPIC A(30)May contain only letters or spaces.
AlphanumericPIC X(30)May contain any characters.
BooleanPIC 1USAGEBITData stored in the form of 0s and 1s, as a binary number.
IndexUSAGEINDEXUsed to reference table elements.
NationalPIC N(30)Similar to alphanumeric, but using an extended character set, e.g.UTF-8.
NumericPIC 9(5)V9(2)Contains exactly 7 digits (7=5+2). 'V' locates the implicit decimal in a fixed point number.
ObjectUSAGEOBJECTREFERENCEMay reference either an object orNULL.
PointerUSAGEPOINTER

Type safety is variable in COBOL. Numeric data is converted between different representations and sizes silently and alphanumeric data can be placed in any data item that can be stored as a string, including numeric and group data.[143] In contrast, object references and pointers may only be assigned from items of the same type and their values may be restricted to a certain type.[144]

PICTURE clause
[edit]

APICTURE (orPIC) clause is a string of characters, each of which represents a portion of the data item and what it may contain. Some picture characters specify the type of the item and how many characters or digits it occupies in memory. For example, a9 indicates a decimal digit, and anS indicates that the item issigned. Other picture characters (calledinsertion andediting characters) specify how an item should be formatted. For example, a series of+ characters define character positions as well as how a leading sign character is to be positioned within the final character data; the rightmost non-numeric character will contain the item's sign, while other character positions corresponding to a+ to the left of this position will contain a space. Repeated characters can be specified more concisely by specifying a number in parentheses after a picture character; for example,9(7) is equivalent to9999999. Picture specifications containing only digit (9) and sign (S) characters define purelynumeric data items, while picture specifications containing alphabetic (A) or alphanumeric (X) characters definealphanumeric data items. The presence of other formatting characters defineedited numeric oredited alphanumeric data items.[145]

Examples
PICTURE clauseValue inValue out
PIC 9(5)10000100
"Hello""Hello" (this is legal, but results inundefined behavior)[143]
PIC +++++-10"  -10" (note leading spaces)
PIC 99/99/9(4)30042003"30/04/2003"
PIC *(4)9.99100.50"**100.50"
0"****0.00"
PIC X(3)BX(3)BX(3)"ABCDEFGHI""ABC DEF GHI"
USAGE clause
[edit]
This sectionis missing information about COMPUTATIONAL-5. Please expand the section to include this information. Further details may exist on thetalk page.(April 2021)

TheUSAGE clause declares the format in which data is stored. Depending on the data type, it can either complement or be used instead of aPICTURE clause. While it can be used to declare pointers and object references, it is mostly geared towards specifying numeric types. These numeric formats are:[146]

  • Binary, where a minimum size is either specified by thePICTURE clause or by aUSAGE clause such asBINARY-LONG
  • USAGECOMPUTATIONAL, where data may be stored in whatever format the implementation provides; often equivalent to  USAGEBINARY
  • USAGEDISPLAY, the default format, where data is stored as a string
  • Floating-point, in either an implementation-dependent format or according to IEEE 754
  • USAGENATIONAL, where data is stored as a string using an extended character set
  • USAGEPACKED-DECIMAL, where data is stored in the smallest possible decimal format (typicallypacked binary-coded decimal)

Report writer

[edit]

The report writer is adeclarative facility for creating reports. The programmer need only specify the report layout and the data required to produce it, freeing them from having to write code to handle things like page breaks, data formatting, and headings and footings.[147]

Reports are associated with report files, which are files which may only be written to through report writer statements.

FDreport-outREPORTsales-report.

Each report is defined in the report section of the data division. A report is split into report groups which define the report's headings, footings and details. Reports work around hierarchicalcontrol breaks. Control breaks occur when a key variable changes it value; for example, when creating a report detailing customers' orders, a control break could occur when the program reaches a different customer's orders. Here is an example report description for a report which gives a salesperson's sales and which warns of any invalid records:

RDsales-reportPAGELIMITS60LINESFIRSTDETAIL3CONTROLSseller-name.01TYPEPAGEHEADING.03COL1VALUE"Sales Report".03COL74VALUE"Page".03COL79PIC Z9SOURCEPAGE-COUNTER.01sales-on-dayTYPEDETAIL,LINE+1.03COL3VALUE"Sales on".03COL12PIC 99/99/9999SOURCEsales-date.03COL21VALUE"were".03COL26PIC $$$$9.99SOURCEsales-amount.01invalid-salesTYPEDETAIL,LINE+1.03COL3VALUE"INVALID RECORD:".03COL19PIC X(34)SOURCEsales-record.01TYPECONTROLHEADINGseller-name,LINE+2.03COL1VALUE"Seller:".03COL9PIC X(30)SOURCEseller-name.

The above report description describes the following layout:

Sales Report                                                             Page  1Seller: Howard Bromberg  Sales on 10/12/2008 were $1000.00  Sales on 12/12/2008 were    $0.00  Sales on 13/12/2008 were   $31.47  INVALID RECORD: Howard Bromberg             XXXXYYSeller: Howard Discount...Sales Report                                                            Page 12  Sales on 08/05/2014 were  $543.98  INVALID RECORD: William Selden      12052014FOOFOO  Sales on 30/05/2014 were    $0.00

Four statements control the report writer:INITIATE, which prepares the report writer for printing;GENERATE, which prints a report group;SUPPRESS, which suppresses the printing of a report group; andTERMINATE, which terminates report processing. For the above sales report example, the procedure division might look like this:

OPENINPUTsales,OUTPUTreport-outINITIATEsales-reportPERFORMUNTIL1<>1READsalesATENDEXITPERFORMEND-READVALIDATEsales-recordIFvalid-recordGENERATEsales-on-dayELSEGENERATEinvalid-salesEND-IFEND-PERFORMTERMINATEsales-reportCLOSEsales,report-out.

Use of the Report Writer facility tends to vary considerably; some organizations use it extensively and some not at all.[148] In addition, implementations of Report Writer ranged in quality, with those at the lower end sometimes using excessive amounts of memory at runtime.[148]

Procedure division

[edit]

Procedures

[edit]

The sections and paragraphs in the procedure division (collectively called procedures) can be used aslabels and as simplesubroutines. Unlike in other divisions, paragraphs do not need to be in sections.[149]

Execution goes down through the procedures of a program until it is terminated.[150]To use procedures as subroutines, thePERFORM verb is used.

APERFORM statement somewhat resembles a procedure call in a newer languages in the sense that execution returns to the code following thePERFORM statement at the end of the called code; however, it does not provide a mechanism forparameter passing or for returning a result value. If a subroutine is invoked using a simple statement likePERFORMsubroutine, then control returns at the end of the called procedure. However,PERFORM is unusual in that it may be used to call a range spanning a sequence of several adjacent procedures. This is done with thePERFORMsub-1THRUsub-n construct:

PROCEDUREso-and-so.PERFORMALPHAPERFORMALPHATHRUGAMMASTOPRUN.ALPHA.DISPLAY'A'.BETA.DISPLAY'B'.GAMMA.DISPLAY'C'.

The output of this program will be: "A A B C".

PERFORM also differs from conventional procedure calls in that there is, at least traditionally, no notion of a call stack. As a consequence, nested invocations are possible (a sequence of code beingPERFORM'ed may execute aPERFORM statement itself), but require extra care if parts of the same code are executed by both invocations. The problem arises when the code in the inner invocation reaches the exit point of the outer invocation. More formally, if control passes through the exit point of aPERFORM invocation that was called earlier but has not yet completed, the COBOL 2002 standard stipulates that the behavior isundefined.

The reason is that COBOL, rather than a "return address", operates with what may be called a continuation address. When control flow reaches the end of any procedure, the continuation address is looked up and control is transferred to that address. Before the program runs, the continuation address for every procedure is initialized to the start address of the procedure that comes next in the program text so that, if noPERFORM statements happen, control flows from top to bottom through the program. But when aPERFORM statement executes, it modifies the continuation address of the called procedure (or the last procedure of the called range, ifPERFORM THRU was used), so that control will return to the call site at the end. The original value is saved and is restored afterwards, but there is only one storage position. If two nested invocations operate on overlapping code, they may interfere which each other's management of the continuation address in several ways.[151][152]

The following example (taken fromVeerman & Verhoeven 2006) illustrates the problem:

LABEL1.DISPLAY'1'PERFORMLABEL2THRULABEL3STOPRUN.LABEL2.DISPLAY'2'PERFORMLABEL3THRULABEL4.LABEL3.DISPLAY'3'.LABEL4.DISPLAY'4'.

One might expect that the output of this program would be "1 2 3 4 3": After displaying "2", the secondPERFORM causes "3" and "4" to be displayed, and then the first invocation continues on with "3". In traditional COBOL implementations, this is not the case. Rather, the firstPERFORM statement sets the continuation address at the end ofLABEL3 so that it will jump back to the call site insideLABEL1. The secondPERFORM statement sets the return at the end ofLABEL4 but does not modify the continuation address ofLABEL3, expecting it to be the default continuation. Thus, when the inner invocation arrives at the end ofLABEL3, it jumps back to the outerPERFORM statement, and the program stops having printed just "1 2 3". On the other hand, in some COBOL implementations like the open-source TinyCOBOL compiler, the twoPERFORM statements do not interfere with each other and the output is indeed "1 2 3 4 3". Therefore, the behavior in such cases is not only (perhaps) surprising, it is also not portable.[152]

A special consequence of this limitation is thatPERFORM cannot be used to write recursive code. Another simple example to illustrate this (slightly simplified fromVeerman & Verhoeven 2006):

MOVE1TOAPERFORMLABELSTOPRUN.LABEL.DISPLAYAIFA<3ADD1TOAPERFORMLABELEND-IFDISPLAY'END'.

One might expect that the output is "1 2 3 END END END", and in fact that is what some COBOL compilers will produce. But other compilers, like IBM COBOL, will produce code that prints "1 2 3 END END END END ..." and so on, printing "END" over and over in an endless loop. Since there is limited space to store backup continuation addresses, the backups get overwritten in the course of recursive invocations, and all that can be restored is the jump back toDISPLAY 'END'.[152]

Statements

[edit]

COBOL 2014 has 47 statements (also calledverbs),[153] which can be grouped into the following broad categories: control flow, I/O, data manipulation and the report writer. The report writer statements are covered in thereport writer section.

Control flow
[edit]

COBOL'sconditional statements areIF andEVALUATE.EVALUATE is aswitch-like statement with the added capability of evaluating multiple values and conditions. This can be used to implementdecision tables. For example, the following might be used to control aCNC lathe:

EVALUATETRUEALSOdesired-speedALSOcurrent-speedWHENlid-closedALSOmin-speedTHRUmax-speedALSOLESSTHANdesired-speedPERFORMspeed-up-machineWHENlid-closedALSOmin-speedTHRUmax-speedALSOGREATERTHANdesired-speedPERFORMslow-down-machineWHENlid-openALSOANYALSONOTZEROPERFORMemergency-stopWHENOTHERCONTINUEEND-EVALUATE

ThePERFORM statement is used to define loops which are executeduntil a condition is true (notwhile true, which is more common in other languages). It is also used to call procedures or ranges of procedures (see theprocedures section for more details).CALL andINVOKE call subprograms and methods, respectively. The name of the subprogram/method is contained in a string which may be a literal or a data item.[154] Parameters can be passedby reference, by content (where a copy is passed by reference) orby value (but only if aprototype is available).[155]CANCEL unloads subprograms from memory.GO TO causes the program to jump to a specified procedure.

TheGOBACK statement is areturn statement and theSTOP statement stops the program. TheEXIT statement has six different formats: it can be used as a return statement, abreak statement, acontinue statement, an end marker or to leave a procedure.[156]

Exceptions are raised by aRAISE statement and caught with a handler, ordeclarative, defined in theDECLARATIVES portion of the procedure division. Declaratives are sections beginning with aUSE statement which specify the errors to handle. Exceptions can be names or objects.RESUME is used in a declarative to jump to the statement after the one that raised the exception or to a procedure outside theDECLARATIVES. Unlike other languages, uncaught exceptions may not terminate the program and the program can proceed unaffected.

I/O
[edit]

File I/O is handled by the self-describingOPEN,CLOSE,READ, andWRITE statements along with a further three:REWRITE, which updates a record;START, which selects subsequent records to access by finding a record with a certain key; andUNLOCK, which releases alock on the last record accessed.

User interaction is done usingACCEPT andDISPLAY.

Data manipulation
[edit]

The following verbs manipulate data:

  • INITIALIZE, which sets data items to their default values.
  • MOVE, whichassigns values to data items ;MOVE CORRESPONDING assigns corresponding like-namedfields.
  • SET, which has 15 formats: it can modify indices, assign object references and alter table capacities, among other functions.[157]
  • ADD,SUBTRACT,MULTIPLY,DIVIDE, andCOMPUTE, which handle arithmetic (withCOMPUTE assigning the result of a formula to a variable).
  • ALLOCATE andFREE, which handledynamic memory.
  • VALIDATE, which validates and distributes data as specified in an item's description in the data division.
  • STRING andUNSTRING, whichconcatenate and splitstrings, respectively.
  • INSPECT, which tallies or replaces instances of specifiedsubstrings within a string.
  • SEARCH, which searches a table for the first entry satisfying a condition.

Files and tables are sorted usingSORT and theMERGE verb merges and sorts files. TheRELEASE verb provides records to sort andRETURN retrieves sorted records in order.

Scope termination

[edit]

Some statements, such asIF andREAD, may themselves contain statements. Such statements may be terminated in two ways: by a period (implicit termination), which terminatesall unterminated statements contained, or by a scope terminator, which terminates the nearest matching open statement.

*> Terminator period ("implicit termination")IFinvalid-recordIFno-more-recordsNEXTSENTENCEELSEREADrecord-fileATENDSETno-more-recordsTOTRUE.*> Scope terminators ("explicit termination")IFinvalid-recordIFno-more-recordsCONTINUEELSEREADrecord-fileATENDSETno-more-recordsTOTRUEEND-READEND-IFEND-IF

Nested statements terminated with a period are a common source of bugs.[158][159] For example, examine the following code:

IFxDISPLAYy.DISPLAYz.

Here, the intent is to displayy andz if conditionx is true. However,z will be displayed whatever the value ofx because theIF statement is terminated by an erroneous period afterDISPLAYy.

Another bug is a result of thedangling else problem, when twoIF statements can associate with anELSE.

IFxIFyDISPLAYaELSEDISPLAYb.

In the above fragment, theELSE associates with the  IFy  statement instead of the  IFx  statement, causing a bug. Prior to the introduction of explicit scope terminators, preventing it would require  ELSENEXTSENTENCE  to be placed after the innerIF.[159]

Self-modifying code

[edit]

The original (1959) COBOL specification supported the infamous  ALTERXTOPROCEEDTOY  statement, for which many compilers generatedself-modifying code.X andY are procedure labels, and the single  GOTO  statement in procedureX executed after such anALTER statement means  GOTOY  instead. Many compilers still support it,[160] but it was deemedobsolete in the COBOL 1985 standard and deleted in 2002.[161]

TheALTER statement was poorly regarded because it undermined "locality of context" and made a program's overall logic difficult to comprehend.[162] As textbook authorDaniel D. McCracken wrote in 1976, when "someone who has never seen the program before must become familiar with it as quickly as possible, sometimes under critical time pressure because the program has failed ... the sight of a GO TO statement in a paragraph by itself, signaling as it does the existence of an unknown number of ALTER statements at unknown locations throughout the program, strikes fear in the heart of the bravest programmer."[162]

Hello, world

[edit]

A"Hello, World!" program in COBOL:

IDENTIFICATIONDIVISION.PROGRAM-ID.hello-world.PROCEDUREDIVISION.DISPLAY"Hello, world!".

When the now famous "Hello, World!" program example inThe C Programming Language was first published in 1978 a similar mainframe COBOL program sample would have been submitted throughJCL, very likely using a punch card reader, and 80 column punch cards. The listing below,with an empty DATA DIVISION, was tested using Linux and the System/370Hercules emulator runningMVS 3.8J. The JCL, written in July 2015, is derived from the Hercules tutorials and samples hosted by Jay Moseley.[163] In keeping with COBOL programming of that era, HELLO, WORLD is displayed in all capital letters.

//COBUCLGJOB(001),'COBOL BASE TEST',00010000//CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1)00020000//BASETESTEXECCOBUCLG00030000//COB.SYSINDD*00040000 00000*VALIDATIONOFBASECOBOLINSTALL00050000 01000IDENTIFICATIONDIVISION.00060000 01100PROGRAM-ID.'HELLO'.00070000 02000ENVIRONMENTDIVISION.00080000 02100CONFIGURATIONSECTION.00090000 02110SOURCE-COMPUTER.GNULINUX.00100000 02120OBJECT-COMPUTER.HERCULES.00110000 02200SPECIAL-NAMES.00120000 02210CONSOLEISCONSL.00130000 03000DATADIVISION.00140000 04000PROCEDUREDIVISION.00150000 04100 00-MAIN.00160000 04110DISPLAY'HELLO, WORLD'UPONCONSL.00170000 04900STOPRUN.00180000//LKED.SYSLIBDDDSNAME=SYS1.COBLIB,DISP=SHR00190000//DDDSNAME=SYS1.LINKLIB,DISP=SHR00200000//GO.SYSPRINTDDSYSOUT=A00210000//00220000

After submitting the JCL, the MVS console displayed:

    19.52.48 JOB    3  $HASP100 COBUCLG  ON READER1     COBOL BASE TEST    19.52.48 JOB    3  IEF677I WARNING MESSAGE(S) FOR JOB COBUCLG  ISSUED    19.52.48 JOB    3  $HASP373 COBUCLG  STARTED - INIT 1 - CLASS A - SYS BSP1    19.52.48 JOB    3  IEC130I SYSPUNCH DD STATEMENT MISSING    19.52.48 JOB    3  IEC130I SYSLIB   DD STATEMENT MISSING    19.52.48 JOB    3  IEC130I SYSPUNCH DD STATEMENT MISSING    19.52.48 JOB    3  IEFACTRT - Stepname  Procstep  Program   Retcode    19.52.48 JOB    3  COBUCLG    BASETEST  COB       IKFCBL00  RC= 0000    19.52.48 JOB    3  COBUCLG    BASETEST  LKED      IEWL      RC= 0000    19.52.48 JOB    3  +HELLO, WORLD    19.52.48 JOB    3  COBUCLG    BASETEST  GO        PGM=*.DD  RC= 0000    19.52.48 JOB    3  $HASP395 COBUCLG  ENDED

Line 10 of the console listing above is highlighted for effect, the highlighting is not part of the actual console output.

The associated compiler listing generated over four pages of technical detail and job run information, for the single line of output from the 14 lines of COBOL.

Reception

[edit]

Lack of structure

[edit]

In the 1970s, adoption of thestructured programming paradigm was becoming increasingly widespread.Edsger Dijkstra, a preeminent computer scientist, wrote aletter to the editor ofCommunications of the ACM, published in 1975 entitled "How do we tell truths that might hurt?", in which he was critical of COBOL and several other contemporary languages; remarking that "the use of COBOL cripples the mind".[164]

In a published dissent to Dijkstra's remarks, the computer scientist Howard E. Tompkins claimed thatunstructured COBOL tended to be "written by programmers that have never had the benefit of structured COBOL taught well", arguing that the issue was primarily one of training.[165]

One cause ofspaghetti code was theGO TO statement. Attempts to removeGO TOs from COBOL code, however, resulted in convoluted programs and reduced code quality.[166]GO TOs were largely replaced by thePERFORM statement and procedures, which promotedmodular programming[166] and gave easy access to powerful looping facilities. However,PERFORM could be used only with procedures so loop bodies were not located where they were used, making programs harder to understand.[167]

COBOL programs were infamous for being monolithic and lacking modularization.[168]COBOL code could be modularized only through procedures, which were found to be inadequate for large systems. It was impossible to restrict access to data, meaning a procedure could access and modifyany data item. Furthermore, there was no way to passparameters to a procedure, an omission Jean Sammet regarded as the committee's biggest mistake.[169]

Another complication stemmed from the ability toPERFORM THRU a specified sequence of procedures. This meant that control could jump to and return from any procedure, creating convoluted control flow and permitting a programmer to break thesingle-entry single-exit rule.[170]

This situation improved as COBOL adopted more features. COBOL-74 added subprograms, giving programmers the ability to control the data each part of the program could access. COBOL-85 then added nested subprograms, allowing programmers to hide subprograms.[171] Further control over data and code came in 2002 when object-oriented programming, user-defined functions and user-defined data types were included.

Nevertheless, much important legacy COBOL software uses unstructured code, which has become practically unmaintainable. It can be too risky and costly to modify even a simple section of code, since it may be used from unknown places in unknown ways.[172]

Compatibility issues

[edit]

COBOL was intended to be a highly portable, "common" language. However, by 2001, around 300 dialects had been created.[173] One source of dialects was the standard itself: the 1974 standard was composed of one mandatory nucleus and eleven functional modules, each containing two or three levels of support. This permitted 104,976 possible variants.[174]

COBOL-85 was not fully compatible with earlier versions, and its development was controversial. Joseph T. Brophy, theCIO ofTravelers Insurance, spearheaded an effort to inform COBOL users of the heavy reprogramming costs of implementing the new standard.[175] As a result, the ANSI COBOL Committee received more than 2,200 letters from the public, mostly negative, requiring the committee to make changes. On the other hand, conversion to COBOL-85 was thought to increase productivity in future years, thus justifying the conversion costs.[176]

Verbose syntax

[edit]
COBOL: /koh′bol/, n.

A weak, verbose, and flabby language used by code grinders to do boring mindless things on dinosaur mainframes. [...] Its very name is seldom uttered without ritual expressions of disgust or horror.

The Jargon File 4.4.8.[177]

COBOL syntax has often been criticized for its verbosity. Proponents say that this was intended to make the codeself-documenting, easing program maintenance.[178] COBOL was also intended to be easy for programmers to learn and use,[179] while still being readable to non-technical staff such as managers.[180][181][182][183]

The desire for readability led to the use of English-like syntax and structural elements, such as nouns, verbs, clauses, sentences, sections, and divisions. Yet by 1984, maintainers of COBOL programs were struggling to deal with "incomprehensible" code[182] and the main changes in COBOL-85 were there to help ease maintenance.[92]

Jean Sammet, a short-range committee member, noted that "little attempt was made to cater to the professional programmer, in fact people whose main interest is programming tend to be very unhappy with COBOL" which she attributed to COBOL's verbose syntax.[184]

The academic world tends to regard COBOL as verbose, clumsy and inelegant, and tries to ignore it, although there are probably more COBOL programs and programmers in the world than there are for FORTRAN, ALGOL and PL/I combined. For the most part, only schools with an immediate vocational objective provide instruction in COBOL.

Richard Conway andDavid Gries, 1973[185]

Later, COBOL suffered from a shortage of material covering it; it took until 1963 for introductory books to appear (with Richard D. Irwin publishing a college textbook on COBOL in 1966).[186] Donald Nelson, chair of the CODASYL COBOL committee, said in 1984 that "academics ... hate COBOL" and that computer science graduates "had 'hate COBOL' drilled into them".[187]

By the mid-1980s, there was also significant condescension towards COBOL in the business community from users of other languages, for exampleFORTRAN orassembler, implying that COBOL could be used only for non-challenging problems.[188]

In 2003, COBOL featured in 80% ofinformation systems curricula in the United States, the same proportion asC++ andJava.[189] Ten years later, a poll byMicro Focus found that 20% of university academics thought COBOL was outdated or dead and that 55% believed their students thought COBOL was outdated or dead. The same poll also found that only 25% of academics had COBOL programming on their curriculum even though 60% thought they should teach it.[190]

Concerns about the design process

[edit]

Doubts have been raised about the competence of the standards committee. Short-term committee member Howard Bromberg said that there was "little control" over the development process and that it was "plagued by discontinuity of personnel and ... a lack of talent."[80] Jean Sammet and Jerome Garfunkel also noted that changes introduced in one revision of the standard would be reverted in the next, due as much to changes in who was in the standard committee as to objective evidence.[191]

COBOL standards have repeatedly suffered from delays: COBOL-85 arrived five years later than hoped,[192] COBOL 2002 was five years late,[3] and COBOL 2014 was six years late.[100][193] To combat delays, the standard committee allowed the creation of optional addenda which would add features more quickly than by waiting for the next standard revision. However, some committee members raised concerns about incompatibilities between implementations and frequent modifications of the standard.[194]

Influences on other languages

[edit]

COBOL's data structures influenced subsequent programming languages. Its record and file structure influencedPL/I andPascal, and theREDEFINES clause was a predecessor to Pascal's variant records. Explicit file structure definitions preceded the development ofdatabase management systems and aggregated data was a significant advance over Fortran's arrays.[195]

PICTURE data declarations were incorporated into PL/I, with minor changes.

COBOL'sCOPY facility, although considered "primitive",[196] influenced the development ofinclude directives.[195]

The focus on portability and standardization meant programs written in COBOL could be portable and facilitated the spread of the language to a wide variety of hardware platforms and operating systems.[197] Additionally, the well-defined division structure restricts the definition of external references to the Environment Division, which simplifies platform changes in particular.[198]

See also

[edit]

Notes

[edit]
  1. ^Specifically influenced COBOL 2002's object-oriented features.[3][4][5]
  2. ^The tombstone is currently at theComputer History Museum.[63]
  3. ^abThe reader should be cautioned that although the 1997Gartner Group study is referenced ubiquitously with a famous "200 billion lines of COBOL" quote, the actual report is difficult to find.[199] Moreover, some speculate[200] that "the only involvement of Gartner in these numbers" was the 1995 study[201] which "projected that fixing the Y2K bug would cost $1 per line or $300 billion total," which caused the misinterpretation of the report.
  4. ^Vendor-specific extensions cause many implementations to have far more: one implementation recognizes over 1,100 keywords.[125]

References

[edit]

Citations

[edit]
  1. ^abSammet, Jean E. (March 2000). "The real creators of Cobol".IEEE Software.17 (2):30–32.doi:10.1109/52.841602.ISSN 1937-4194.The Short-Range Committee worked diligently from June 1959 on, but there were great difficulties in having a fairly large committee try to create a programming language. In November, the Short-Range Committee chair appointed six people to develop specifications for consideration: William Selden and Gertrude Tierney (IBM), Howard Bromberg and Norman Discount (RCA), and Vernon Reeves and Jean E. Sammet (Sylvania Electric Products). We worked for two full weeks (including some round-the-clock sessions) in November 1959 and sent the proposed specifications to the full Short-Range Committee, which accepted almost all of them. After some editing (by the same six people), we turned in the specifications as a final report in December to the Executive Committee, which accepted them in January 1960. After some further editing, the Government Printing Office issued Cobol 60. [...] [Grace Hopper] did not participate in its work except through the general guidance she gave to her staff who were direct committee members. Thus, while her indirect influence was very important, regrettably the frequent repeated statements that "Grace Hopper developed Cobol" or "Grace Hopper was a codeveloper of Cobol" or "Grace Hopper is the mother of Cobol" are just not correct.
  2. ^Technical Standard, COBOL Language(PDF). X/Open Company Ltd., U.K. December 1991.ISBN 1-872630-09-X.
  3. ^abcSaade, Henry; Wallace, Ann (October 1995)."COBOL '97: A Status Report".Dr. Dobb's Journal. Archived fromthe original on 22 April 2014. Retrieved21 April 2014.
  4. ^abArranga, Edmund C.; Coyle, Frank P. (February 1998).Object-Oriented COBOL.Cambridge University Press. p. 15.ISBN 978-0132611404.Object-Oriented COBOL's style reflects the influence of Smalltalk and C++.
  5. ^Arranga, Edmund C.; Coyle, Frank P. (March 1997). "Cobol: Perception and Reality".Computer.30 (3): 127.doi:10.1109/2.573683.ISSN 0018-9162.
  6. ^Imajo, Tetsuji; et al. (September 2000).COBOL Script: a business-oriented scripting language.Enterprise Distributed Object Computing Conference. Makuhari, Japan: IEEE.doi:10.1109/EDOC.2000.882363.ISBN 0769508650.
  7. ^Ho, Wing Hong (7 May 2007)."Introduction to EGL"(PDF). IBM Software Group. Archived fromthe original(PDF) on 13 January 2019. Retrieved12 January 2019.
  8. ^Radin, George (1978). Wexelblat, Richard L. (ed.).The early history and characteristics of PL/I. History of Programming Languages.Academic Press (published 1981). p. 572.doi:10.1145/800025.1198410.ISBN 0127450408.
  9. ^"What is PL/B - The Programming Language for Business?".sysmaker.com. Infopro, Inc. Retrieved22 April 2022.... conversion to an alternate, extended COBOL or to ANSI COBOL is very difficult, if at all possible
  10. ^abcMitchell, Robert L. (4 October 2006)."Cobol: Not Dead Yet".Computerworld. Retrieved10 December 2024.
  11. ^Mitchell, Robert L. (14 March 2012)."Brain drain: Where Cobol systems go from here".Computerworld. Retrieved9 February 2015.
  12. ^Ensmenger, Nathan L. (2009).The Computer Boys Take Over: Computers, Programmers, and the Politics of Technical Expertise.MIT Press. p. 100.ISBN 978-0262050937.LCCN 2009052638.
  13. ^ISO/IEC JTC 1/SC 22/WG 4 2023.
  14. ^"Mainframe COBOL Programming".
  15. ^Groenfeldt, Tom."Covid Accelerates Banks' Mainframe Migration to Cloud".Forbes.
  16. ^Beyer 2009, p. 282.
  17. ^Gürer, Denise (1 June 2002). "Pioneering Women in Computer Science".SIGCSE Bull.34 (2):175–180.doi:10.1145/543812.543853.ISSN 0097-8418.S2CID 2577644.
  18. ^Beyer 2009, pp. 281–282.
  19. ^Sammet 1978a, p. 200.
  20. ^Flahive, Paul (24 May 2019)."How COBOL Still Powers The Global Economy At 60 Years Old".Texas Public Radio. Archived fromthe original on 24 May 2019. Retrieved19 July 2019.(Grace Hopper) Nicknamed Grandma Cobol, the code was based on some of her earlier work. She said — after hearing the rumors — one of her collaborators went out and bought a granite tombstone. "He had the word COBOL cut in the front of it. Then he shipped it express collect to Mr. Phillips in the pentagon." The prank on Charles Phillips, a leader for the project at the defense department, got the attention of the powers that be and was a turning point she said. COBOL would go on to become the most widely used and longest lasting computer languages in history.
  21. ^Beyer 2009, p. 283.
  22. ^Beyer 2009, p. 284.
  23. ^"Early Meetings of the Conference on Data Systems Languages".IEEE Annals of the History of Computing.7 (4):316–325. 1985.doi:10.1109/MAHC.1985.10047.S2CID 35625728.
  24. ^abcdeSammet 2004, p. 104.
  25. ^Beyer 2009, p. 286.
  26. ^abConner 1984, p. ID/9.
  27. ^Sammet 1978a, p. 201.
  28. ^abcdBemer 1971, p. 132.
  29. ^Beyer 2009, p. 288.
  30. ^Sammet 1978a, p. 203.
  31. ^CODASYL 1969, § I.2.1.1.
  32. ^Sammet 1978a, p. 204.
  33. ^CODASYL 1969, § I.1.2.
  34. ^Beyer 2009, p. 290.
  35. ^Sammet, Jean (1978). "The Early History of COBOL".ACM SIGPLAN Notices.13 (8):121–161.doi:10.1145/960118.808378.S2CID 10743643.
  36. ^Sammet 1978a, p. 217.
  37. ^Adams, Vicki Porter (5 October 1981)."Captain Grace M. Hopper: the Mother of COBOL".InfoWorld. Vol. 3, no. 20. p. 33.ISSN 0199-6649.
  38. ^Betts, Mitch (6 January 1992)."Grace Hopper, mother of Cobol, dies".Computerworld.26 (1): 14.
  39. ^Lohr, Steve (2008).Go To: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Maverick Scientists, and Iconoclasts—The Programmers Who Created the Software Revolution.Basic Books. p. 52.ISBN 978-0786730766.
  40. ^"Pioneering software engineer and Cobol co-designer".The Irish Times.
  41. ^abBeyer 2009, p. 292.
  42. ^Bemer 1971, p. 131.
  43. ^Beyer 2009, p. 296.
  44. ^Sammet 1978a, p. 221.
  45. ^Beyer 2009, p. 291.
  46. ^"Oral History of Captain Grace Hopper"(PDF).Computer History Museum. December 1980. p. 37. Archived fromthe original(PDF) on 25 December 2017. Retrieved28 June 2014.
  47. ^Sammet 1978a, p. 218.
  48. ^Marcotty 1978a, p. 268.
  49. ^Sammet 1978a, pp. 205–206.
  50. ^abSammet 1978a, Figure 8.
  51. ^Sammet 1978a, pp. 230–231.
  52. ^ISO/IEC JTC 1/SC 22/WG 4 2001, p. 846.
  53. ^Sammet 1978a, p. 220.
  54. ^Sammet 1978a, p. 228.
  55. ^Sammet 1978a, p. 210.
  56. ^Bemer 1971, p. 132:We can't find a single individual who admits coining the acronym "COBOL".
  57. ^Sammet 1978a, p. 210:The next day, the name COBOL was finally agreed to as an acronym for COmmon Business Oriented Language. Unfortunately, my notes do not show who made that suggestion.
  58. ^Sullivan, Patricia (25 June 2004)."Computer Pioneer Bob Bemer, 84".The Washington Post. p. B06. Retrieved28 June 2014.
  59. ^"THE COBOL REPORT - Interview with Bob Bemer - the Father of COBOL". Archived fromthe original on 2 April 2018.
  60. ^"THE COBOL REPORT - Interview with Bob Bemer - the Father of COBOL". Archived fromthe original on 23 December 2003.
  61. ^Beyer 2009, p. 293.
  62. ^Beyer 2009, p. 294.
  63. ^COBOL Tombstone. Computer History Museum. 1960. Retrieved29 June 2014.
  64. ^"The Story of the COBOL Tombstone"(PDF).The Computer Museum Report.13:8–9. Summer 1985.Archived(PDF) from the original on 3 April 2014. Retrieved29 June 2014.
  65. ^Bemer 1971, p. 130.
  66. ^Beyer 2009, p. 289.
  67. ^CODASYL 1969, § I.1.1.
  68. ^Brown 1976, p. 47.
  69. ^abBemer 1971, p. 133.
  70. ^abBeyer 2009, p. 297.
  71. ^Williams, Kathleen Broome (10 November 2012).Grace Hopper: Admiral of the Cyber Sea. US Naval Institute Press.ISBN 978-1612512655.OCLC 818867202.
  72. ^Compaq Computer Corporation:Compaq COBOL Reference Manual, Order Number: AA–Q2G0F–TK October 2000, Page xviii; Fujitsu Corporation:Net Cobol Language Reference, Version 15, January 2009; IBM Corporation:Enterprise COBOL for z/OS Language Reference, Version 4 Release 1, SC23-8528-00, December 2007
  73. ^Garfunkel, Jerome (11 November 1984)."In defense of Cobol".Computerworld.18 (24): ID/19.
  74. ^Pratt, Terrence W. (1975).Programming Languages: Design and Implementation. Englewood Cliffs, New Jersey: Prentice Hall. pp. 361–362,381–382.ISBN 0-13-730432-3.
  75. ^abBemer 1971, p. 134.
  76. ^Brown 1976, p. 48.
  77. ^CODASYL 1969, § I.2.2.4.
  78. ^CODASYL 1969, § I.2.3.
  79. ^abcdFollet, Robert H.;Sammet, Jean E. (2003)."Programming language standards". In Ralston, Anthony; Reilly, Edwin D.; Hemmendinger, David (eds.).Encyclopedia of Computer Science (4th ed.). Wiley. p. 1467.ISBN 978-0470864128.
  80. ^abBeyer 2009, p. 301.
  81. ^abBrown 1976, p. 49.
  82. ^Brown 1976, p. 52.
  83. ^Taylor, Alan (2 August 1972)."Few Realise Wasted Resources of Local DP Schools".Computerworld.6 (31): 11.
  84. ^Triance, J. M. (1974).Programming in COBOL: A Course of Twelve Television Lectures. Manchester University Press. p. 87.ISBN 978-0719005923.
  85. ^Klein 2010, p. 16.
  86. ^Baird, George N.; Oliver, Paul (May 1977). "1974 Standard (X3.23–1974)".Programming Language Standards—Who Needs Them?(PDF) (Report).Department of the Navy. pp. 19–21.Archived(PDF) from the original on 7 January 2014. Retrieved7 January 2014.
  87. ^Culleton, John R. Jr. (23 July 1975)."'Spotty' Availability A Problem..."Computerworld.9 (30): 17.
  88. ^Simmons, Williams B. (18 June 1975)."Does Cobol's Report Writer Really Miss the Mark?".Computerworld.9 (25): 20.
  89. ^Shoor, Rita (26 January 1981)."User Threatens Suit Over Ansi Cobol-80".Computerworld.15 (4): 1, 8.
  90. ^Shoor, Rita (26 October 1981)."DPMA Takes Stand Against Cobol Draft".Computerworld.15 (43):1–2.
  91. ^abcGallant, John (16 September 1985)."Revised Cobol standard may be ready in late '85".Computerworld.19 (37): 1, 8.
  92. ^ab"Expert addresses Cobol 85 standard".Computerworld.19 (37): 41, 48. 16 September 1985.
  93. ^Paul, Lois (15 March 1982)."Responses to Cobol-80 Overwhelmingly Negative".Computerworld.16 (11): 1, 5.
  94. ^Paul, Lois (25 April 1983)."Study Sees Few Problems Switching to Cobol-8X".Computerworld.17 (17): 1, 6.
  95. ^Gillin, Paul (19 November 1984)."DEC users get head start implementing Cobol-80".Computerworld.18 (47): 1, 6.
  96. ^ClearPath Enterprise Servers (April 2015)."COBOL ANSI-85 Programming Reference Manual"(PDF).public.support.unisys.com. Unisys. Retrieved29 April 2022.
  97. ^Garfunkel 1987, p. 150.
  98. ^Roy, M. K.; Dastidar, D. Ghost (1 June 1989). "Features of COBOL-85".COBOL Programming: Problems and Solutions (2nd ed.). McGraw-Hill Education. pp. 438–451.ISBN 978-0074603185.
  99. ^Robinson, Brian (9 July 2009)."Cobol remains old standby at agencies despite showing its age".FCW. Public Sector Media Group. Archived fromthe original on 27 April 2014. Retrieved26 April 2014.
  100. ^ab"COBOL Standards". Micro Focus. Archived fromthe original on 31 March 2004. Retrieved2 September 2014.
  101. ^"NetCOBOL for .Net".netcobol.com. GTSoftware. 2013. Archived fromthe original on 8 July 2014. Retrieved29 January 2014.
  102. ^"A list of Codasyl Cobol features".Computerworld.18 (37): ID/28. 10 September 1984. Retrieved8 June 2014.
  103. ^ISO/IEC JTC 1/SC 22/WG 4 2001, Annex F.
  104. ^Klein 2010, p. 21.
  105. ^ab"JTC1/SC22/WG4 – COBOL". ISO. 30 June 2010. Archived fromthe original on 14 February 2014. Retrieved27 April 2014.
  106. ^Billman, John; Klink, Huib (27 February 2008)."Thoughts on the Future of COBOL Standardization"(PDF). Archived fromthe original(PDF) on 11 July 2009. Retrieved14 August 2014.
  107. ^ISO/IEC JTC 1/SC 22/WG 4 2014, Annex E.
  108. ^Schricker, Don (2 December 1998)."J4: COBOL Standardization". Micro Focus. Archived fromthe original on 24 February 1999. Retrieved12 July 2014.
  109. ^abcISO/IEC JTC 1/SC 22/WG 4 2023, § E.3.1.
  110. ^abcdeISO/IEC JTC 1/SC 22/WG 4 2023, § E.3.2.
  111. ^ISO/IEC JTC 1/SC 22/WG 4 2023, § 12.4.4.9.
  112. ^ISO/IEC JTC 1/SC 22/WG 4 2023, § 8.7.2.
  113. ^Kizior, Ronald J.; Carr, Donald; Halpern, Paul."Does COBOL Have a Future?"(PDF).The Proceedings of the Information Systems Education Conference 2000.17 (126). Archived fromthe original(PDF) on 17 August 2016. Retrieved30 September 2012.
  114. ^White, Doug (12 July 1998)."Frequently Asked Questions (FAQ) About the Y2K Problem".homepages.wmich.edu. Archived fromthe original on 7 November 2021. Retrieved29 April 2022.Thus, the main problem of Y2K is the problem of incorrect results when date mathematics are conducted.
  115. ^Kappelman, Leon A. (2000)."Some strategic Y2K blessings".IEEE Software.17 (2):42–46.doi:10.1109/52.841605.
  116. ^Carr & Kizior 2003, p. 16.
  117. ^Carr & Kizior 2003, p. 10.
  118. ^"Cobol brain drain: Survey results".Computerworld. 14 March 2012. Archived fromthe original on 27 April 2014. Retrieved27 April 2014.
  119. ^Powner, David A. (25 May 2016)."Federal Agencies Need to Address Aging Legacy Systems"(PDF).Government Accountability Office. p. 18. Archived fromthe original(PDF) on 15 June 2016. Retrieved19 July 2019.Several agencies, such as the Department of Agriculture (USDA), DHS, HHS, Justice, Treasury, and VA, reported using Common Business Oriented Language (COBOL)—a programming language developed in the late 1950s and early 1960s—to program their legacy systems. It is widely known that agencies need to move to more modern, maintainable languages, as appropriate and feasible.
  120. ^"COBOL blues".Reuters. Retrieved8 April 2020.
  121. ^Teplitzky, Phil (25 October 2019)."Closing the COBOL Programming Skills Gap".IBM Systems Magazine, IBM Z. Archived fromthe original on 13 April 2020. Retrieved11 June 2020.
  122. ^Lee, Alicia (8 April 2020)."Wanted urgently: People who know a half century-old computer language so states can process unemployment claims".CNN. Retrieved8 April 2020.
  123. ^Long, Heather; Stein, Jeff; Rein, Lisa; Romm, Tony (17 April 2020)."Stimulus checks and other coronavirus relief hindered by dated technology and rocky government rollout".The Washington Post. Retrieved19 April 2020.
  124. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § 8.9.
  125. ^"Reserved Words Table".Micro Focus Visual COBOL 2.2 COBOL Language Reference.Micro Focus. Retrieved3 March 2014.
  126. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § 8.3.1.2.
  127. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § 8.3.2.
  128. ^"Introduction to COBOL".James Madison University. Retrieved10 December 2024.
  129. ^McCracken 1976, pp. 2, 6–9.
  130. ^abISO/IEC JTC 1/SC 22/WG 4 2001, § F.2.
  131. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § D.18.2.
  132. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § D.18.
  133. ^ISO/IEC JTC 1/SC 22/WG 4 2014, p. 108.
  134. ^ISO/IEC JTC 1/SC 22/WG 4 2014, p. 896.
  135. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § D.2.1.
  136. ^"File Organizations".File Handling. Micro Focus. 1998. Archived fromthe original on 4 March 2016. Retrieved27 June 2014.
  137. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § 8.5.1.2.
  138. ^Cutler 2014, Appendix A.
  139. ^Hubbell, Thane (1999).Sams Teach Yourself COBOL in 24 hours.SAMS Publishing. p. 40.ISBN 978-0672314537.LCCN 98087215.
  140. ^McCracken & Golden 1988, § 19.9.
  141. ^Cutler 2014, § 5.8.5.
  142. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § 8.5.2.
  143. ^abISO/IEC JTC 1/SC 22/WG 4 2014, § 14.9.24.
  144. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § 14.9.35.
  145. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § 13.18.40.
  146. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § 13.18.60.3.
  147. ^ISO/IEC JTC 1/SC 22/WG 4 2014, p. 855.
  148. ^abMcCracken 1976, p. 338.
  149. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § 14.4.
  150. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § 14.6.3.
  151. ^Field, John; Ramalingam, G. (September 1999).Identifying Procedural Structure in Cobol Programs(PDF).PASTE '99.doi:10.1145/381788.316163.ISBN 1581131372.Archived(PDF) from the original on 24 December 2010.
  152. ^abcVeerman, Niels; Verhoeven, Ernst-Jan (November 2006)."Cobol minefield detection"(PDF).Software: Practice and Experience.36 (14).doi:10.1002/spe.v36:14.S2CID 18619757. Archived fromthe original(PDF) on 6 March 2007.
  153. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § 14.9.
  154. ^ISO/IEC JTC 1/SC 22/WG 4 2014, §§ 14.9.4, 14.9.22.
  155. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § D.6.5.2.2.
  156. ^ISO/IEC JTC 1/SC 22/WG 4 2014, § 14.9.13.1.
  157. ^ISO/IEC JTC 1/SC 22/WG 4 2014, §14.9.35.1.
  158. ^ISO/IEC JTC 1/SC 22/WG 4 2014, p. 899.
  159. ^abMcCracken & Golden 1988, § 8.4.
  160. ^Examples of compiler support forALTER can be seen in the following:
    • Tiffin, Brian (18 September 2013)."September 2013".GNU Cobol. Archived fromthe original on 5 May 2014. Retrieved5 January 2014.
    • "The ALTER Statement".Micro Focus Visual COBOL 2.2 for Visual Studio 2013 COBOL Language Reference. Micro Focus. Retrieved5 January 2014.
    • "ALTER Statement (Nucleus)"(PDF).COBOL85 Reference Manual. Fujitsu. November 1996. p. 555. Archived fromthe original(PDF) on 6 January 2014. Retrieved5 January 2014.
    • "ALTER Statement".Enterprise COBOL for z/OS Language Reference. IBM. June 2013. Retrieved5 January 2014.
  161. ^ISO/IEC JTC 1/SC 22/WG 4 2001, § F.1.
  162. ^abMcCracken 1976, p. 355.
  163. ^Moseley, Jay (17 January 2015)."COBOL Compiler from MVT". Retrieved19 July 2015.
  164. ^Dijkstra, Edsger W. (18 June 1975)."How do we tell truths that might hurt?". University of Texas at Austin. EWD498. Archived fromthe original on 2 May 2017. Retrieved29 August 2007.
  165. ^Tompkins, H. E. (1983)."In defense of teaching structured COBOL as computer science".ACM SIGPLAN Notices.18 (4):86–94.doi:10.1145/948176.948186.S2CID 33803213.
  166. ^abRiehle 1992, p. 125.
  167. ^Shneiderman 1985, pp. 349–350.
  168. ^Coughlan, Michael (16 March 2014).Beginning COBOL for Programmers. Apress. p. 4.ISBN 978-1430262534. Retrieved13 August 2014.
  169. ^Sammet 1978b, p. 258.
  170. ^Riehle 1992, p. 126.
  171. ^Riehle 1992, p. 127.
  172. ^"COBOL and Legacy Code as a Systemic Risk | naked capitalism". 19 July 2016. Retrieved23 July 2016.
  173. ^Lämmel, Ralf;Verhoef, Chris (November–December 2001)."Cracking the 500-language problem"(PDF).IEEE Software.18 (6): 79.doi:10.1109/52.965809.hdl:1871/9853. Archived fromthe original(PDF) on 19 August 2014.
  174. ^Howkins, T. J.; Harandi, M. T. (April 1979)."Towards more portable COBOL".The Computer Journal.22 (4): 290.doi:10.1093/comjnl/22.4.290.
  175. ^Garfunkel 1987, p. 11.
  176. ^Garfunkel 1987, p. 15.
  177. ^Raymond, Eric S. (1 October 2004)."COBOL".The Jargon File, version 4.4.8.Archived from the original on 30 August 2014. Retrieved13 December 2014.
  178. ^Brown 1976, p. 53.
  179. ^CODASYL 1969, § II.1.1.
  180. ^Shneiderman 1985, p. 350.
  181. ^Sammet 1961, p. 381.
  182. ^abConner 1984, p. ID/10.
  183. ^Marcotty 1978a, p. 263.
  184. ^Conner 1984, p. ID/14.
  185. ^Conway, Richard; Gries, David (1973).An Introduction to Programming: A Structured Approach using PL/1 and PL/C. Cambridge, Massachusetts: Winthrop Publishers. p. 341.ISBN 0-87626-405-4.
  186. ^"COBOL Logic and Programming, third edition 1974". Archived fromthe original on 5 March 2016. Retrieved25 February 2016.
  187. ^"An interview: Cobol defender".Computerworld.18 (37): ID/29–ID/32. 10 September 1984. Retrieved8 June 2014.
  188. ^Pratt, Terrence W.;Zelkowitz, Marvin V. (1984).Programming Languages: Design and Implementation (2nd ed.). Englewood Cliffs, N.J. : Prentice Hall.ISBN 0136780121.
  189. ^Carr & Kizior 2003, p. 13.
  190. ^"Academia needs more support to tackle the IT skills gap" (Press release). Micro Focus. 7 March 2013. Retrieved4 August 2014.
  191. ^Sammet, Jean; Garfunkel, Jerome (October 1985). "Summary of Changes in COBOL, 1960–1985".Annals of the History of Computing.7 (4): 342.doi:10.1109/MAHC.1985.10033.S2CID 17940092.
  192. ^Cook, Margaret M. (June 1978). Ghosh, Sakti P.; Liu, Leonard Y. (eds.).Data Base Facility for COBOL 80(PDF). 1978 National Computer Conference. Anaheim, California: AFIPS Press. pp. 1107–1112.doi:10.1109/AFIPS.1978.63.LCCN 55-44701. Retrieved2 September 2014.The earliest date that a new COBOL standard could be developed and approved is the year 1980 [...].
  193. ^"Resolutions from WG4 meeting 24 – June 26–28, 2003 Las Vegas, Nevada, USA". 11 July 2003. p. 1. Archived fromthe original(doc) on 8 March 2016. Retrieved29 June 2014.a June 2008 revision of the COBOL standard
  194. ^Babcock, Charles (14 July 1986)."Cobol standard add-ons flayed".Computerworld.20 (28): 1, 12.
  195. ^abShneiderman 1985, p. 349.
  196. ^Marcotty 1978b, p. 274.
  197. ^This can be seen in:
    • "Visual COBOL".IBM PartnerWorld.IBM. 21 August 2013.Archived from the original on 12 July 2014. Retrieved5 February 2014.Micro Focus Visual COBOL delivers the next generation of COBOL development and deployment for Linux x86-64, Linux for System z, AIX, HP/UX, Solaris, and Windows.
    • "IBM COBOL Compiler Family".IBM. 16 May 2024. Retrieved11 September 2024.
    • "GnuCOBOL - GNU Project". Retrieved11 September 2024.
  198. ^Coughlan, Michael (2002)."Introduction to COBOL". Archived fromthe original on 5 March 2023.
  199. ^"Gartner Group Studies".1997-2001.state.gov. Year 2000 Program Management Office. 2000. Retrieved23 April 2022.
  200. ^Engelmann, Viktor (8 April 2021)."COBOL Fact-Check".cobsolete.de. COBSOLETE. Retrieved23 April 2022.
  201. ^"What Will the Future Hold".CIO. International Data Group. 15 December 1995 – 1 January 1996. p. 82.

Sources

[edit]

External links

[edit]
COBOL at Wikipedia'ssister projects
1–9999
10000–19999
20000–29999
30000+
IEC
ISO/IEC
Related
Authority control databases: NationalEdit this at Wikidata
Retrieved from "https://en.wikipedia.org/w/index.php?title=COBOL&oldid=1283462636"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp