开个坑 打算把掌握Mainframe里有趣的教程搬过来 今天先搬COBOL
About COBOL
COBOL is not a general purpose programming language. You wouldn’t write an operating system, AI algorithm, or racing sim in it. Where it excels is turning out high-precision business transactions like the ones you find in banks, credit card processors, and other financial institutions. Its rigid structure and adherence to a very specific specification mean that it’s also easy to read and trace through, something that helps with audits and compliance. Today, COBOL runs much of the world’s highest-earning businesses, and once you start to see how it was architected, you’ll begin to see just why.
COBOL 严谨的结构具有易读性以及良好的代码可追踪性;有利于审计与商业执行。 因此今天许多需求高精度的商业领域如银行、信用卡机构等普遍采用COBOL作为事务处理语言。
十分钟学习COBOL 视频
https://www.bilibili.com/video/BV1UK4y157vN
示例代码3.5
掌握Mainframe系列教程中的3.5节
IDENTIFICATION DIVISION.
PROGRAM-ID. ADDONE.
AUTHOR. STUDENT.
*
ENVIRONMENT DIVISION.
*
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT PRT-LINE ASSIGN TO PRTLINE.
SELECT PRT-DONE ASSIGN TO PRTDONE.
DATA DIVISION.
FILE SECTION.
FD PRT-LINE RECORD CONTAINS 80 CHARACTERS RECORDING MODE F.
01 PRT-REC PIC X(80) VALUE SPACES.
FD PRT-DONE RECORD CONTAINS <