段PROGRAM-ID. EXAMPLE. 句MOVE A TO B. 标识部: IDENTIFICATION DIVISION. PROGRAM-ID. EXAMPLE. 环境部: ENVIRONMENT DIVISION. CONFIGURATION SECTION. INPUT-OUTPUT SECTION. 数据部: DATA DIVISION. FILE SECTION. WORKING-STORAGE SECTION. 过程部: PROCEDURE SECTION. MAIN-PROCEDURE. DISPLAY ‘HELLO WORLD!’...
WORKING-STORAGE SECTION. PROCEDURE DIVISION. MAIN-PROCEDURE. DISPLAY "Hello world, from How-To Geek!" STOP RUN. END PROGRAM Hello-World. 蓬勃发展几十年,如今却无法迁移和升级 虽然用今天的眼光看,COBOL 的设计已经非常笨拙,但在刚诞生的时候,这绝对是一种革命性的编程语言。COBOL 在金融部门、联邦政府以...
下面的例子是MAIN调用程序,UTIL是被调用程序−IDENTIFICATION DIVISION. PROGRAM-ID. MAIN. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-STUDENT-ID PIC 9(4) VALUE 1000. 01 WS-STUDENT-NAME PIC A(15) VALUE 'Tim'. PROCEDURE DIVISION. CALL 'UTIL' USING WS-STUDENT-ID, WS-STUDENT-NAME. ...
10 WK-CHAR-0 PIC X(1) VALUE '0'. PROCEDURE DIVISION. *--- * MAIN ROUTINE *--- MAIN-ROUTINE. PERFORM TEST-01 THRU TEST-01-EXIT PERFORM TEST-02 THRU TEST-02-EXIT . MAIN-ROUTINE-EXIT. STOP RUN. *---
MAIN-PROCEDURE. DISPLAY "1. Deposit". DISPLAY "2. Withdraw". DISPLAY "3. Check Balance". DISPLAY "4. Exit". ACCEPT CHOICE. PERFORM PROCESS-CHOICE UNTIL CHOICE = '4'. STOP RUN. PROCESS-CHOICE. IF CHOICE = '1' THEN ACCEPT ACCOUNT-NUMBER. ACCEPT BALANCE. ADD BALANCE TO BALANCE. ELSE ...
PROCEDURE DIVISION. MAIN-LOGIC. PERFORM UNTIL SCREEN-COUNTER > 5 DISPLAY "Screen " SCREEN-COUNTER ADD 1 TO SCREEN-COUNTER END-PERFORM. STOP RUN. 在上述示例中,使用了一个名为SCREEN-COUNTER的变量来跟踪屏幕的数量。通过PERFORM UNTIL循环,屏幕计数器逐渐增加,并在每次循环中显示当前屏幕的编号。循环将...
// ASCII码27 PROCEDURE DIVISION. MAIN-LOGIC. DISPLAY ESCAPE-CHARACTER. DISPLAY "2J". // 清除屏幕 DISPLAY ESCAPE-CHARACTER. DISPLAY "24;1H". // 将光标位置设置到第24行第1列 ... // 其他代码 STOP RUN. 在上面的示例代码中,使用了ASCII码27和一些特殊的控制字符来清除屏幕并将光标...
1. * Hello World in Cobol2. ***3. IDENTIFICATION DIVISION.4. PROGRAM-ID. HELLO.5. ENVIRONMENT DIVISION.6. DATA DIVISION.7. PROCEDURE DIVISION.8. MAIN SECTION.9. DISPLAY "Hello World!"10.STOP RUN.11. *** COBOL等语言编写的数字资产的重要性 和COBOL比起来,就连C语言这样在现在许多新人程序...
PROCEDURE DIVISION USING cobol-id, valid-responses, progr, system-id, subtext, len-text, retcode. main-proc. *** * check for typical messages and take appropriate action * *** EVALUATE cobol-id WHEN "LBE7604" *** * stop literal
PROCEDURE DIVISl0NA000-MAIN-PROCESSENTRY DLITCBL USING EMPLOYEE-DB-PCB-MASKDLITCBL是“DL/I to COBOL”的缩写。 COBOL中调用DL/I函数CALLCBLTDBI USINGDL/I-functionPCB-maskSEGMENT-IO-AREASEGMENT-SEARCH-ARGUMA74TS.CBLTDL表示“COBOL to DL/I”。 下述内容将在IMS相关课程中介绍nIMS数据库的结构和...