跌打滚爬中的小菜鸟...
分类: 其他UNIX
2015-12-07 13:26:43
例子:
0009.00 INPUT-OUTPUT SECTION.
0010.00 FILE-CONTROL.
0011.00 SELECT DATA-FILE ASSIGN TO DATABASE-ITEM
0012.00 ORGANIZATION IS INDEXED
0013.00 ACCESS DYNAMIC
0014.00 RECORD KEY IS EXTERNALLY-DESCRIBED-KEY
0015.00 WITH DUPLICATES //不加这句话,有重复KEY的文件打开后状态会是95
0016.00 FILE STATUS IS DATA-STATUS.
0017.00
0018.00 DATA DIVISION.
-
Organization |
Access mode |
File type |
SEQUENTIAL |
Sequential mode |
|
INDEXED |
Sequential mode Random mode Dynamic mode |
|
RELATIVE |
Sequential mode Random mode Dynamic mode |
|
TRANSACTION |
|
|
Organization: 声明文件的逻辑结构。
Sequential organization: 记录的物理写入顺序。
Indexed organization: 基于key和排序方式的顺序。
Relative organization: RRN顺序。
Transaction organization: 画面专用~
Access mode: 声明读写文件的操作顺序,具体依赖于organization。
Sequential-access mode: 按顺序读写。
Random-access mode: 可以随机读写。
Dynamic-access mode: 可以动态指定按顺序or随机读写。(不明白)
SELECT中常用的4种Device,
DATABASE 任何数据文件
DISK 任何PF或者但format的LF
FORMATFILE 用于Printer file
WORKSTATION 用于Display file