4.2.14 FILE STATUS Clause
The FILE STATUS clause monitors the execution of each input-output
operation for the file.
When the FILE STATUS clause is specified, the system moves a value into
the status key data item after each input-output operation that explicitly
or implicitly refers to this file. The value indicates the status of
execution of the statement. (See the "Status Key" description under
"Common Processing Facilities" in topic 6.1.8.9.)
-
data-name-1
-
The status key data item can be defined in the Working-Storage,
X Local-Storage, or Linkage sections as either of the following:
- A 2-character alphanumeric item
- X A 2-character numeric data item, with explicit or implicit USAGE
X IS DISPLAY. It is treated as an alphanumeric item.
X Note: Data-name-1 must not contain the PICTURE symbol 'P'.
Data-name-1 can be qualified.
X The status key data item must not be variably located; that is, the
X data item cannot follow a data item containing an OCCURS DEPENDING ON
X clause.
-
X data-name-8
-
X Represents information returned from the file system. Since the
X definitions are specific to the file systems and platforms,
X applications that depend on the specific values in data-name-8 might
X not be portable across platforms.
X >_Host_> Under OS/390 and VM, data-name-8 must be defined as a group
X item of 6 bytes in the Working-Storage or Linkage Section of the Data
X Division.
X Specify data-name-8 only if the file is a VSAM file (that is, ESDS,
X KSDS, RRDS).
X On OS/390 and VM, for VSAM files the 6-byte VSAM return code is
X comprised of the following:
- X The first 2 bytes of data-name-8 contain the VSAM return code in
X binary notation. The value for this code is defined (by VSAM) as
X 0, 8, or 12.
- X The next 2 bytes of data-name-8 contain the VSAM function code in
X binary notation. The value for this code is defined (by VSAM) as
X 0, 1, 2, 3, 4, or 5.
- X The last 2 bytes of data-name-8 contain the VSAM feedback code in
X binary notation. The code value is 0 through 255.
X If VSAM returns a nonzero return code, data-name-8 is set.
X If FILE STATUS is returned without having called VSAM, data-name-8 is
X zero.
X If data-name-1 is set to zero, the content of data-name-8 is
X undefined. VSAM status return code information is available without
X transformation in the currently defined COBOL FILE STATUS code. User
X identification and handling of exception conditions are allowed at the
X same level as that defined by VSAM.
X Function code and feedback code are set if and only if the return code
X is set to nonzero. If they are referenced when the return code is set
X to zero, the contents of the fields are not dependable.
X Definitions of values in the return code, function code, and feedback
X code fields are defined by VSAM. There are no COBOL additions,
X deletions, or modifications to the VSAM definitions. For more
X information, see VSAM Administration: Macro Instruction Reference.
X <_Host_<
X >_Workstation_> Under AIX, OS/2, and Windows, how you define
X data-name-8 is dependent on the file system you are using.
X Btrieve, STL, and Native Platform File Systems
-
X You must define data-name-8 with PICTURE 9(6) and USAGE
X DISPLAY attributes. However, you can define an additional
X field with PICTURE X(n). The file system defines the
X feedback values, which are converted to the six digit
X external decimal representation with leading zeros, when the
X file systems feedback value is less than 100000. If you
X have defined an additional field using PICTURE X(n), then
X X(n) contains additional information describing any non-zero
X feedback code. (For most programs, an 'n' value of 100
X should be adequate to show the complete message text. If
X the file is defined with a large number of alternate keys
X then allow 100 bytes plus 20 bytes per alternate key.)
X VSAM File System
-
X You must define data-name-8 with PICTURE X(n) and USAGE
X DISPLAY attributes, where 'n' is 6 or greater. The PICTURE
X string value represents the first 'n' bytes of the VSAM
X reply message structure (defined by VSAM). If the size of
X the reply message structure (m) is shorter than 'n', only
X the first 'm' bytes contain useful information.
X Note: This also applies to SFS files accessed through VSAM
X on AIX.
X For information on VSAM file handling on the workstation, see:
- X For AIX: SMARTdata UTILITIES for AIX: VSAM in a Distributed
X Environment
- X For OS/2: SMARTdata UTILITIES for OS/2: VSAM in a Distributed
X Environment
- X For Windows: SMARTdata UTILITIES User's Guide for Windows
X <_Workstation_<
© Copyright IBM Corp. 1991, 1998
IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.
Return to library:
z/OS |
z/OS.e |
TPF |
z/VSE |
z/VM |
IBM Hardware |
IBM System z Redbooks
Glossary:
IBM terminology
Publications:
How to order publications
Readers:
Download IBM Library Reader |
Download IBM Softcopy Reader |
Download Adobe® Acrobat® Reader®
Library management:
Download IBM Softcopy Librarian
Contacts:
Contact z/OS
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks
of Adobe Systems incorporated.