COBOL
英文缩写: COBOL (Common business Oriented Language)
中文译名: COBOL语言
解 释: 一种适合于商业及数据处理的类似英语的程序设计语言。这种语言可使商业数据处理过程精确表达。
COBOL(面向商业的通用语言,又称为企业管理语言、数据处理语言等,Common Business Oriented Langauge)是最早的高级编程语言之一,是世界上第一个商用语言。
翻译:English abbreviation: COBOL (Common business Oriented Language)
English translation: COBOL Language
Explanation: a suitable commercial and data processing procedures similar to the English language This language allows precise expression of commercial data processing
COBOL (Common Business Oriented Language, also known as enterprise management language, data processing and language, Common Business Oriented Langauge) is the first high-level programming language is one of the world's first commercial language
COBOL的历史
1959年5月,五角大楼委托格雷斯·霍波(GHopper)博士领导一个委员会并由Rear Admiral Grace Hopper公司主持开发,并于1961年由美国数据系统语言协会公布。正式发布于1960年4月,称为Cobol-60。
1968年美国国家标准委员会ANSI又通过了新的标准ANSI COBOL X323-1968。
1972年国际标准化组织ISO将其作为ISO COBOL-72。1974年ANSI对COBOL-68作出了修订扩充,形成了ANSI COBOL X323-1974,随后1978年ISO采用其形成ISO COBOL-78,后来又提出了ANSI X323-85,增加了很多结构化程序设计的内容,ISO标准ISO1989:1985也采用了该标准。COBOL标准还在不断地改进和完善,最新的标准COBOL 2002主体已经于2002年12月出版,其他部分还在不断地完善之中。现在最新的版本是Cobol-2002。
1963年,美国国家标准研究所(ANSI)进行了标准化,但是ANSI标准很少被遵循;因此,COBOL程序只是部分可移植的。
翻译:The history of COBOL
In May 1959, the Pentagon commissioned格雷斯霍波(G Hopper) by a committee led by Dr Rear Admiral Grace Hopper led the development of the company, and in 1961 by the American Association of Data Systems Languages Officially released in April 1960, known as the Cobol-60
1968, American National Standards Institute ANSI has adopted a new standard ANSI COBOL X323-1968
1972 International Organization for Standardization ISO as ISO COBOL-72 1974 Nian ANSI pairs of COBOL-68 was amended in expanded form ANSI COBOL X323-1974, following its formation in 1978, ISO using ISO COBOL-78, and later proposed ANSI X323-85, increased the number of structured programming content, ISO standard ISO1989: 1985 also adopted the standard COBOL standards are continuing to improve and perfect the latest standard COBOL 2002 subjects have been published in December 2002, other parts are still being constantly improved Now, its latest version of Cobol-2002
In 1963, the American National Standards Institute (ANSI) has standardized, but the ANSI standard are rarely followed; so, COBOL programs only partially portable
COBOL的重要性
经过40多年的不断修改、丰富完善和标准化,COBOL已发展为多种版本的庞大语言,在财会工作、统计报表、计划编制、情报检索、人事管理等数据管理及商业数据处理领域,都有着广泛的应用。
COBOL的重要性可以用这句话来描述:世界上70%的数据都是用COBOL语言处理的,并且90%的ATM事务处理用的都是COBOL语言。每天在线处理的COBOL事务有300亿次。500强中有492家(包括全部的100强)使用了COBOL语言,目前在COBOL方面的投资已经超过3万亿美元,,据称用COBOL书写的程序超过了1000亿行,并且以每年大约50亿行代码的速度在增长。
由于COBOL在商业领域的雄厚基础,而且COBOL主要是应用于银行、金融和会计行业等非常重要的商业数据处理领域。所以,即使对于具有相当经验的IT公司来说,重新编写COBOL语言的可靠的应用软件也是不实际或是从商业角度上并不可行的,而且还要花上很长的时间,只要大型机存在,COBOL就不会消失,即使是对电脑界产生巨大影响的“千年虫”(Y2K)也没有改变COBOL的命运。
翻译:The importance of COBOL After 40 years of constant change, rich sound and standardization, COBOL has evolved into multiple versions of a large language, accounting, statistical reporting, planning, information retrieval, personnel management, data management and business data processing , all have a wide range of applications The importance of COBOL can use these words to describe: The World's 70% of the data is to use COBOL language processing, and 90% of ATM transactions are used in COBOL language COBOL matters dealt with every day online 300 million times 500 There are 492 (including all of the 100) uses the COBOL language COBOL investments currently has more than three trillion US dollars, allegedly written in COBOL programs with more than one hundred billion rows, and about 50 per year 100 million lines of code at the rate of growth Since COBOL strong foundation in the commercial sphere, and COBOL is mainly used in banking, finance and accounting industries are very important business data processing Therefore, even for considerable experience in IT companies, rewriting COBOL language, the application of reliable software is not practical or not feasible from a business point of view, but also spend a very long time, as long as there is mainframe , COBOL will not disappear, even for the computer industry a tremendous impact on the "millennium bug" (Y2K) did not change the fate of COBOL
COBOL的特点
COBOL是一种面向数据处理的、面向文件的、面向过程(POL)的高级编程语言,是一种功能很强而又极为冗长的语言。
COBOL适合于具有循环处理周期的环境(例如打印工资支票)以及数据操纵量相当大的环境。COBOL主要应用于商业数据处理领域,对各种类型的数据进行收集、存储、传送、分类、排序、计算及打印报表、输出图象是它的强项。
COBOL语法与英文很接近,即使不懂电脑的人也能看懂程序。
强大的文件处理功能,大量的数据通常以文件的形式存储在磁盘上。
仅提供了加、减、乘、除及乘方这五种简单的算术运算,因而不适于进行科学计算。
未来的COBOL将支持XML等Web时代的新技术。
翻译:The characteristics of COBOL
COBOL is a data-oriented processing, file-oriented, process-oriented (POL) high-level programming language, is a feature very strong but extremely lengthy language
COBOL for the processing cycle with the cycle of the environment (for example, print pay checks) as well as a large amount of data manipulation environment COBOL is mainly used in commercial data processing, for various types of data collection, storage, transmission, classification, sorting, calculation and printing reports, the output image is its strength
COBOL grammar and English is very close, even if people do not understand the computer program can read
Powerful document processing capabilities, large amounts of data are usually in the form of files stored on disk
Provided only add, subtract, multiply, divide, and involution of these five simple arithmetic operations, and thus not suitable for scientific computing
COBOL will support the future of XML and other Web era of new technologies
COBOL的程序结构
COBOL程序由4部(DIVISION)组成:IDENTIFICATION DIVISION(标识部)、ENVIRONMENT DIVISION(环境部)、DATA DIVISION(数据部)、PROCEDURE DIVISION(过程部),而每个部又由若干节 (SECTION)组成。
IDENTIFICATION DIVISION
“PROGRAM-ID”(程序识别ID)、“AUTHOR”(作者名)、“DATE-WRITTEN”(编写日期),这些并直接不影响程序的执行,而是程序的注释 信息。程序注释可以采用任何语言书写,COBOL编译器可以接受。
ENVIRONMENT DIVISION
用于记载程序可以被运行的计算机环境。“ENVIRONMENT DIVISION”部包括“CONFIGURATION SECTION”环境节和“INPUT-OUTPUT SECTION”输入输出节。
DATA DIVISION
用于定义和声明程序所要使用的变量及其他数据。程序要使用的全部变量和数据必须在这里定义。“DATA DIVISION”部主要包含“FILE SECTION”和“WORKING-STORAGE SECTION”节。
如果程序要通过参数接收数据,那么使用“LINKAGE SECTION”来声明。
COBOL的数据种类
COBOL程序的数据,主要有以下3种:
变量(Variables)
常量(Literals)
表意常量(FigurativeConstants)变量和常量自不必说,说说表意常量。使用有特定意思的多个词组合成一个常量的代名词。好处是便于编码人员识别。比如:HIGH-VALUES、LOW-VALUES等可以表达一定意思的名称作为常量代名词。
COBOL变量类型
COBOL的基本变量类型,有以下三种:
数值型(Numeric)
英文字符型(AlphaNumeric)
英文字符串型(Alphabetic)
PROCEDURE DIVISION
用于容纳程序的实际处理代码。需要传入参数时,采用“PROCEDURE DIVISION USING 引数名[,参数名]”的方式。
因为前3个DIVISION都是注释,却又必须,只到第4个DIVISION“PROCEDURE DIVISION”才真正涉及程序代码,这样的繁琐规定使得COBOL被批评为开场白像老太太裹脚布。但是,基于这样的4个DIVISION的明确记述等的严格形式,COBOL也被公认是可读性强的语言。另外,COBOL的保留字数量庞大,字数过长的保留字太多是COBOL的特征之一。
目前Cobol 就业市场包含以下两种类型:
第一,在旧的 Cobol 代码和新程序之间充当桥梁,这种工作要求人们懂 Cobol,懂那些老 Cobol 程序员所依赖的商业逻辑,同时动新的编程语言,如 Java。
第二是维护旧的 Cobol 代码,并编写新的 Cobol 代码。
翻译:COBOL program structure of COBOL programs from the four (DIVISION) composed of: IDENTIFICATION DIVISION (ID Department), ENVIRONMENT DIVISION (Ministry of the Environment), DATA DIVISION (Data Division), PROCEDURE DIVISION (The process of Department), and each department also by a number of sections (SECTION) component IDENTIFICATION DIVISION "PROGRAM-ID" (identification process ID), "AUTHOR" (author name), "DATE-WRITTEN" (write the date), which do not directly affect the program execution, but the program notes the information Program notes written in any language can be used, COBOL compiler is acceptable ENVIRONMENT DIVISION Recorded program can be used to run computer environment "ENVIRONMENT DIVISION" Department, including "CONFIGURATION SECTION" Environment Day and "INPUT-OUTPUT SECTION" input-output section DATA DIVISION Definitions and declarations for procedures to be used for variables and other data Program to use all the variables and data must be defined here "DATA DIVISION" Department consists mainly of "FILE SECTION" And "WORKING-STORAGE SECTION" Festival If the program is to pass parameters to receive data, then use the "LINKAGE SECTION" to the statement COBOL data types of COBOL program data, mainly in the following three kinds: variables (Variables) Constants (Literals) ideographic constant (FigurativeConstants) variables and constant self-Needless to say, talk about the ideographic constant Use of a specific meaning of a constant synthesis of a number of phrases synonymous The advantage of facilitating coders identified For example: HIGH-VALUES, LOW-VALUES, etc can express a certain meaning of the name as synonymous with a constant COBOL variable type of the basic variable types of COBOL, the following three ways: numeric (Numeric) English character (AlphaNumeric) English string (Alphabetic) PROCEDURE DIVISION is used to accommodate the actual processing procedure code Need to pass parameters using "PROCEDURE DIVISION USING argument name [, parameter names ]" way Because the former are three DIVISION notes, but must be only to the first 4 DIVISION "PROCEDURE DIVISION" really involved in the program code, such as red tape makes COBOL has been criticized for his opening remarks, like the old lady bindings However, based on these four DIVISION such a clear account of the strict form, COBOL has also been recognized as readable language In addition, COBOL reserved words large number of long words is a COBOL reserved word too much one of the characteristics Cobol job market at present contains the following two types: first, in the old Cobol code and to act as a bridge between the new procedures, this kind of work requires people to understand Cobol, understand those old Cobol programmers rely on business logic, while moving the new programming languages such as Java The second is to maintain the old Cobol code, and the preparation of new Cobol code
1 PERFORM VARYING A FROM 1 BY -1 UNTIL A>100 , 会死循环;
2 IF 100(A)=ZERO , 应该是你写错或看错了吧, 这里的"100" 换成个数组变量就可以了, 就像 WA-NAME(A), 但是得当心数组溢出;
3 07 ABCDESFG OCCURS 8, 就像定义了一张表---"ABCDESFG", 一般都这么用,
01 WA-TABLE
05 WA-STUDENT-TABLE OCCURS 100
10 WA-NO PIC X(10)
10 WA-NAME PIC X(20)
10 WA-ADDRESS PIC X(30)
这样就定义了一张可容100条记录的学生表了,每条记录都有3个字段
欢迎分享,转载请注明来源:品搜搜测评网