VSAM file status

1 篇文章 0 订阅
1 篇文章 0 订阅


状态码

 

    在FILE-CONTROL节采用了FILE STATUS子句,则由其指定的2字节的字符型数据项记录文件操作的状态码,该状态码在执行EXCEPTION/ERROR声明或INVALID KEY/AT END子句前填写。其他状态由FILE STATUS从句中的data-name-8描述,它不能用于QSAM文件(OS/390、VM)以及行顺序文件(Workstation)。

 

+--------------------------------------------------------------------------+

|Table 32. 状态码码值和含义                                                |

+------------------+-------------------------------------------------------+

|高位数字含义      | 低位数字含义                                          |

+-----+------------+-----+-------------------------------------------------+

| 0   |成功结束    |无更多信息                                       |

              +-----+-------------------------------------------------+

              |仅适用于有允许重复值的替换索引的索引文件         |

                                                                 |

                 |输入输出语句正确执行,但发现了重复值.             |

                 |-对于READ语句,当前读出的关键字和下一个记录关键字 |

                 | 相同.                                                     |

                 |-对于REWRITE或WRITE语句,当前写入的记录与现有记录 |

                 | 关键字重复.                                                       |

              +-------------------------------------------------------+

              |READ语句成功执行,但是读出的记录长度与文件描述不  |

                 |一致.                                                                  |

    |            +-------------------------------------------------------+

              |OPEN语句成功执行,但是用optional引用的文件不存在, |

                 |文件模式为I-O或者EXTEND时,成功地建立了文件.      |

                 |对OS/390和VM VSAM顺序文件不适用.                       |

              +-----+-------------------------------------------------+

              |带NO REWIND,REEL/UNIT或FOR REMOVAL子句的CLOSE语句|

                 |或带NO REWINDI子句的OPEN语句,引用的文件不在可反转|

                 |媒介上.                                          |

+-----+------------+-----+-------------------------------------------------+

| 1   |读写文件结束|  |顺序读文件遇到文件结束,没有逻辑记录.             |

    |condition      |首次读optional文件,但是文件不存在.               |

              +-----+-------------------------------------------------+

              |顺序读相对文件,但是相对记录号的标志数字大于相对码|

                 |数据项的尺寸.                                    |

+-----+------------+-----+-------------------------------------------------+

| 2   |无效码      |顺序存取索引文件存在次序(sequence)错.            |

                 |在一次READ成功后,REWRITE执行前,记录的主码被改变|

                 |了,或者是下一个记录的主码不满足升序限制         |

                                                                |

                 |对于OS/2 for Btrieve索引文件,状态21不可用。此时 |

                 |可以码的任意次序顺序创建记录                     |

              +-----+-------------------------------------------------+

              |写入记录将引起码值重复(相对文件)               |

                 |写入或者重写记录将导致主码或附属码重复,但在索引 |

                 |文件中并没有DUPLICATES子句                       |

              +-----+-------------------------------------------------+

              |试图随机访问文件中并不存在的记录,或试图对一个设 |

                 |成optinal而不存在的输入文件进行START或READ       |

              +-----+-------------------------------------------------+

              |写相对文件活或索引文件超出了外部定义的边界       |

                 |或者试图对相对文件进行WRITE,但相对记录号中的    |

                 |significant digits超过了定义的最大长度           |

+-----+------------+-----+-------------------------------------------------+

| 3   |Permanent                                                  |

    |错误条件    +-----+-------------------------------------------------+

              |边界冲突                                         |

                 |写超出了外部定义的顺序文件边界                   |

              +-----+-------------------------------------------------+

              |带有INPUT、I-O或EXTEND子句的OPEN语句试图访问一个 |

                 |不存在的文件,而该文件没有设成optinal            |

              +-----+-------------------------------------------------+

              |文件不支持OPEN语句指定的打开方式:               |

                                                                |

                 |1.  指定了EXTEND或OUTPUT子句,但文件不支持写操作 |

                 |2.  指定了I-O子句,但文件不支持I-O操作           |

                 |3.  指定了INPUT子句,但文件不允许读              |

              +-----+-------------------------------------------------+

              |试图OPEN一个已经带锁关闭的文件                   |

              +-----+-------------------------------------------------+

              |OPEN语句失败——程序指定的文件属性与文件属性不同 |

                 |这些属性包括:文件组织方式(顺序、相对、索引), |

                 |主码,次码,字符集,最大纪录长度,记录类型(定长 |

                 |或变长),块填充度等。                           |

                                                                |

                 |对于AIX、OS/2和Windows,状态39不适用于行顺序文件 |

                 |或B树文件(line sequential files、Btrievefiles.  |

+-----+------------+-----+-------------------------------------------------+

| 4   |逻辑错误    |试图打开已经打开的文件                           |

    |condition                                                     |

              +-----+-------------------------------------------------+

              |试图关闭一个未打开的文件                         |

                                                                |

              +-----+-------------------------------------------------+

              |对于大规模存储器上以顺序存取方式打开的文件来说, |

                 |在执行REWRITE语句之前的IO语句不是一个成功的READ  |

                  |语句                                             |

                                                                |

                 |对于以顺序存取方式打开的相对、索引文件来说,     |

                 |在执行REWRITE或DELETE语句之前的IO语句不是一个    |

                  |成功的READ语句                                   |

              +-----+-------------------------------------------------+

              |边界冲突——试图重写REWRITE一个记录,但是记录长度|

                 |不匹配。对于变长记录,可能是记录长度超过最小或最 |

|                   |大允许的长度。                                  |

                 |RECORD IS VARYING                                |

              +-----+-------------------------------------------------+

              |顺序读取一个以INPUT或I-O方式打开的文件,但是没有 |

                 |下一个有效记录:                                 |

                 |1.  前一个READ语句失败,但是没有产生结束条件     |

                 |2.  前一个READ语句产生了AT END条件               |

              +-----+-------------------------------------------------+

              |试图读取一个不是以INPUT或者I-O方式打开的文件     |

                                                                |

              +-----+-------------------------------------------------+

               |试图写一个不是以I-O、OUTPUT或EXTEND方式打开的文件|

                                                                |

              +-----+-------------------------------------------------+

              |试图删除或重写(DELETE or REWRITE)一个不是以I-O |

                 |方式打开的文件                                   |

+-----+------------+-----+-------------------------------------------------+

|9    |实现者定义                                                 |

    |的条件      +-----+-------------------------------------------------+

              |对VSAM文件(OS/390和VM): 文件口令错             |

                                                                |

                 |在AIX、OS/2和Windows中: 权限不够                 |

              +-----+-------------------------------------------------+

              |逻辑错误                                         |

              +-----+-------------------------------------------------+

              |除了QSAM文件外: 资源不可用                       |

              +-----+-------------------------------------------------+

              |对VSAM文件(OS/390和VM下,带CMPR2编译选项):    |

                 |以顺序方式存取文件而没有文件位置指示             |

                                                                 |

                 |在AIX、OS/2和Windows中: 并发打开错误             |

              +-----+-------------------------------------------------+

              |除了QSAM文件以外: 无效或不完全的文件信息         |

              +-----+-------------------------------------------------+

              |对VSAM文件(限于OS/390和VM): 没有DD语句         |

                                                                |

              |     |对QSAM文件(限于OS/390和VM): 没有DD语句,并且   |

                 |设置了CBLQDA(OFF)                                |

                                                                |

                 |在AIX、OS/2和Windows中: 文件名错                 |

              +-----+-------------------------------------------------+

              |对VSAM文件(限于OS/390和VM): OPEN执行成功,并   |

                 |验证了文件完整性                                 |

                                                                |

                 |在AIX、OS/2和Windows中:  访问远程文件出错        |

              +-----+-------------------------------------------------+

              |在AIX、OS/2和Windows中: 打开已经封锁的文件失败   |

                                                                 |

              +-----+-------------------------------------------------+

              |在AIX、OS/2和Windows中: 访问已经封锁的记录失败   |

                                                                |

+-----+------------+-----+-------------------------------------------------+

 

Status
Key-1

Condition

Status
Key-2

Description


 


 


 


 

0

Successful
Completion

0

No further information

 

 

2

The input-output statement was successfully executed, but a duplicate key was detected. For a READ statement the key value for the current key of reference was equal to the value of the same key in the next record within the current key of reference. For a REWRITE or WRITE statement, the record just written created a duplicate key value for at least one alternate record key for which duplicates are allowed.

 

 

4

A READ statement was successfully executed, but the length of the record being processed did not conform to the fixed file attributes for that file.

 

 

5

An OPEN statement is successfully executed but the referenced optional file is not present at the time the OPEN statement is executed. If the open mode is I-O, the file has been created. Under MVS, the file has been created if the open mode is I-O or EXTEND. This does not apply to VSAM sequential files. File status 0 is returned.

 

 

7

For a CLOSE statement with the NO REWIND, REEL/UNIT, or FOR REMOVAL phrase or for an OPEN statement with the NO REWIND phrase, the referenced file was on a non-reel/unit medium.


 


 


 


 

1

At END

0

A sequential READ statement was attempted and no next logical record existed in the file because the end of the file had been reached, or the first READ was attempted on an optional input file that was not present.

 

 

4

A sequential READ statement was attempted for a relative file and the number of significant digits in the relative record number was larger than the size of the relative key data item described for the file.


 


 


 


 

2

Invalid key

1

A sequence error exists for a sequentially accessed indexed file. The prime record key value has been changed by the program between the successful execution of a READ statement and the execution of the next REWRITE statement for that file, or the ascending requirements for successive record key values were violated.

 

 

2

An attempt was made to write a record that would create a duplicate key in a relative file; or an attempt was made to write or rewrite a record that would create a duplicate prime record key or a duplicate alternate record key without the DUPLICATES phrase in an indexed file. This key value applies to an indexed file in which the alternate key has been declared 'UNIQUE'.

 

 

3

An attempt was made to randomly access a record that does not exist in the file, or a START or random READ statement was attempted on an optional input file that was not present.

 

 

4

An attempt was made to write beyond the externally defined boundaries of a relative or indexed file. Or, a sequential WRITE statement was attempted for a relative file and the number of significant digits in the relative record number was larger than the size of the relative key data item described for the file.


 


 


 


 

3

Permanent error

0

No further information.

 

 

4

A permanent error exists because of a boundary violation; an attempt was made to write beyond the externally-defined boundaries of a sequential file.

 

 

5

An OPEN statement with the INPUT, I-O, or EXTEND phrase was attempted on a non-optional file that was not present.

 

 

7

An OPEN statement was attempted on a file that would not support the open mode specified in the OPEN statement. Possible violations are:
1. The EXTEND or OUTPUT phrase was specified but the file would not support write operations.
2. The I-O phrase was specified but the file would not support the input and output operations permitted.
3. The INPUT phrase was specified but the file would not support read operations.
4. Under VSE, the EXTEND phrase was specified for a SAM file.

 

 

8

An OPEN statement was attempted on a file previously closed with lock.

 

 

9

The OPEN statement was unsuccessful because a conflict was detected between the fixed file attributes and the attributes specified for that file in the program. These attributes include the organization of the file (sequential, relative, or indexed), the prime record key, the alternate record keys, the code set, the maximum record size, the record type (fixed or variable), and the blocking factor.


 


 


 


 

4

Logic error

1

An OPEN statement was attempted for a file in the open mode.

 

 

2

A CLOSE statement was attempted for a file not in the open mode.

 

 

3

For a mass storage file in the sequential access mode, the last input-output statement executed for the associated file prior to the execution of a REWRITE statement was not a successfully executed READ statement.
For relative and indexed files in the sequential access mode, the last input-output statement executed for the file prior to the execution of a DELETE or REWRITE statement was not a successfully executed READ statement.

 

 

4

A boundary violation exists because an attempt was made to rewrite a record to a file and the record was not the same size as the record being replaced, or an attempt was made to write or rewrite a record that was larger than the largest or smaller than the smallest record allowed by the RECORD IS VARYING clause of the associated file-name.

 

 

5

An attempt has been made to REWRITE a record to a file, and the record is not the same size as the record being replaced.
(Micro Focus) For line sequential files this refers to the physical size of the record, that is after space removal, tab compression and null insertion. In this case, the physical size of the new record is allowed to be smaller than that of the record being replaced.

 

 

6

A sequential READ statement was attempted on a file open in the input or I-O mode and no valid next record had been established because:
1. The preceding READ statement was unsuccessful but did not cause an at end condition
2. The preceding READ statement caused an at end condition.

 

 

7

The execution of a READ statement was attempted on a file not open in the input or I-O mode.

 

 

8

The execution of a WRITE statement was attempted on a file not open in the I-O, output, or extend mode.

 

 

9

The execution of a DELETE or REWRITE statement was attempted on a file not open in the I-O mode.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值