标识部的格式:
标识部(IDENTIFICATION DIVISION)
代码范例:
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)
代码范例
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