一步步Cobol 400 上手自学入门教程02 - 程序结构

标识部的格式:

标识部(IDENTIFICATION DIVISION)

用来标识程序名称,记录程序的文档记录住处如作者和日期等。

一步步Cobol 400 上手自学入门教程02 - 程序结构

代码范例:

IDENTIFICATION DIVISION.
PROGRAM-ID. IDSAMPLE.
AUTHOR. PROGRAMMER NAME.
INSTALLATION. COBOL DEVELOPMENT CENTER.
DATE-WRITTEN. 08/27/88.
DATE-COMPILED. 09/01/88 12:57:53.
SECURITY. NON-CONFIDENTIAL.

环境部的格式:

环境部(ENVIRONMENT DIVISION)

用来描述程序运行和编译的计算机环境,内部数据文件与系统设备的对应关系。

一步步Cobol 400 上手自学入门教程02 - 程序结构

代码范例

ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-AS400.
OBJECT-COMPUTER. IBM-AS400.
SPECIAL-NAMES. Cð1 IS TOP-OF-PAGE.

SOURCE-COMPUTER 定义的是需要编译原代码的机器.OBJECT-COMPUTER是目标计算机

SPECIAL-NAMES的范例:

SPECIAL-NAMES. SYSTEM-CONSOLE IS SYSTM
REQUESTOR IS WORK-STATION
C01 IS NEXT-PAGE
LOCAL-DATA IS LOCAL-DATA-AREA
ATTRIBUTE-DATA IS ATTRB-DATA
SYSTEM-SHUTDOWN IS SHUTDOWN-SWITCH
ON STATUS IS SHUTDOWN-PENDING
UPSI-0 IS UPSI-SWITCH-0
ON STATUS IS U0-ON
OFF STATUS IS U0-OFF
UPSI-1 IS UPSI-SWITCH-1
ON STATUS IS U1-ON
OFF STATUS IS U1-OFF
IBM-ASCII IS STANDARD-1
CURRENCY-SIGN IS "Y".

Environment Division—Input-Output

指定外部存储和输入输出设备,文件类型包含四种文件,database files, device files, DDM files, and save files

上一篇:【Common】NO.81.Note.1.Common.1.001-【各种英文符号的表示及念法】


下一篇:[iOS]圆形进度条及计时功能