ReadFileExample. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT InputFile ASSIGN TO 'input.dat' ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD InputFile. 01 InputRecord PIC X(100). WORKING-STORAGE SECTION. 01 ProcessedData PIC X(100). PROCEDURE DIVISION. OPEN...
FILE-CONTROL. SELECT InputFile ASSIGN TO 'input-data.txt' ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD InputFile. 01 InputRecord PIC X(80). WORKING-STORAGE SECTION. 01 WS-Data PIC X(80). PROCEDURE DIVISION. Open-File. OPEN INPUT InputFile. Read-File. PERFORM UNTIL EO...
PROGRAM-ID. LISTADOPT. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT LISTING ASSIGN TO PRINTER-QPRINT ORGANIZATION IS SEQUENTIAL. DATA DIVISION. FILE SECTION. FD LISTING RECORD CONTAINS 132 CHARACTERS LABEL RECORDS ARE STANDARD DATA RECORD IS LIST-LINE. 01 LIST-LINE PIC X(132). * WORKING-STORAGE ...
(1)文件节(FILE SECTION) 用来描述程序中用到的输入文件和输出文件及其记录中各数据项的属性。 (2)工作单元节(WORKING-STORAGE SECTION) 用来描述程序中用到的中间数据项。 (3)联接节(LINKAGE SECTION) 用来描述与调用程序间发生数据传递的数据项。 (4)报表节(REPORT SECTION) 为了完成报表编制功能,此节用来规定...
PROGRAM-ID. EXAMPLE. 环境部: ENVIRONMENT DIVISION. CONFIGURATION SECTION. INPUT-OUTPUT SECTION. 数据部: DATA DIVISION. FILE SECTION. WORKING-STORAGE SECTION. 过程部: PROCEDURE SECTION. MAIN-PROCEDURE. DISPLAY ‘HELLO WORLD!’. STOP RUN.
COBOL语言程序设计 6.1 表的概念 COBOL语言中的表(TABLE)类似于其他高级语言中的数组(ARRAY)。Student-recordwangmath9(4)2019/3/11 zhangmath9(4)eng9(4)………math9(4)lieng9(4)zhumath9(4)eng9(4)eng9(4)COBOL语言程序设计 01student-record.02wang.03mathpic9(4).03engpic9(4).02zhang.03...
部主要包含“FILE SECTION.”和“WORKING-STORAGE SECTION.”节。 如果程序要通过参数接收数据,那么使用“LINKAGE SECTION”来声明。 COBOL的数据种类 COBOL程序的数据,主要有以下3种: 变量(Variables) 常量(Literals) 表意常量(FigurativeConstants)变量和常量自不必说,说说表意常量。使用有特定意思的多个词组合成一个...
Q2) What are the different data types available in COBOL?A2) Alpha-numeric (X), alphabetic (A) and numeric (9).Q:COBOL有哪些可用的数据类型 A:字符型(这里指的是包含字母和数字),字母型,数字型 Q3) What does the INITIALIZE verb do? - GS A3) Alphabetic, Alphanumeric fields & alpha...
SECTION. For example, If the record structure that the programmer has declared is 52 bytes, blocks of 52 byte data (records) are assumed to placed one after another in the file. If the programmer is reading the data in a sequential file, every READ statement brings 52 bytes into the ...
EXAMPLE. DATE-WRITTEN. 03/25/98. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. DATA DIVISION. FILE SECTION. WORKING-STORAGE SECTION. EXEC SQL INCLUDE SQLCA END-EXEC. *** * DECLARE A HOST VARIABLE TO HOLD INPUT SCHEMA *** 01 INSCHEMA PIC X(8). *** * DECLARE...