File Control Description (FCD)

The fields contained in the FCD are shown in the following table. The fields do not necessarily appear in this order; the order is defined in the copy book . For flags, the description refers to when the bit is set on. Bit 7 is the most significant (leftmost) bit. Unused bits are reserved for future use.
Field name Type Description of the Field
fcd-file-status
  • fcd-status-key-1
  • fcd-status-key-2
As below:
  • fcd-status-key-1 : pic x
  • fcd-status-key-2 : pic x
User file status. After every operation except a COMMIT or ROLLBACK operation, this field is updated with a standard file status value telling you the status of the operation. See also fcd-access-mode and fcd-status-type.
fcd-length pic xx comp-x
fcd-version pic x comp-x
fcd-organization pic x comp-x File organization:
  • 0 - Line sequential
  • 1 - Sequential
  • 2 - Indexed
  • 3 - Relative
fcd-access-mode pic x comp-x User status and access mode indicators.

User status is indicated by bit 7. The bit is set if you have defined a file status. Defining a file status can affect how some operations (such as RETRYLOCK) are performed. When calling the File Handler directly, this bit should be set. However, file status is obtained directly from fcd-file-status.

Access mode is indicated by bits 6 through 0:

  • 0 - Sequential access mode
  • 4 - Random access mode
  • 8 - Dynamic access mode
fcd-open-mode pic x comp-x Open mode:
  • 0 - INPUT
  • 1 - OUTPUT
  • 2 - I/O
  • 3 - EXTEND
  • 128 - File is closed

You must set this field to 128 before opening a file.

fcd-recording-mode pic x comp-x Recording mode
  • 0 - Fixed
  • 1- Variable
fcd-file-format pic x comp-x File format
  • 0 - Default format
  • 1 - C-ISAM
  • 2 - Level II V2.5 COBOL
  • 3 - IDXFORMAT"3"
  • 4 - IDXFORMAT"4"
  • 8 - IDXFORMAT"8"
  • 11 - Mainframe print file
  • 14 - Heap file
  • 15 - ESDS
fcd-device-flag pic x comp-x
fcd-lock-action pic x comp-x Reserved.
fcd-data-compress pic x comp-x Data compression routine indicator:
  • 0 - No compression
  • 1-127 - Micro Focus data compression routine number (1= CBLDC001)
  • 128 -255 - User-defined data compression routine number (128=USRDC128)
fcd-blocking pic x comp-x Node length in bytes:
  • 0 - Node length determined by system
  • 1 - 512
  • 2 - 1024
  • 4 - 4096
  • 6 - 16384
fcd-idxcache-size pic x comp-x Number of index nodes held in cached memory. The number specified should be between 4 and 64. When set to 0, a default of 16 is used.
fcd-percent pic x comp-x Percentage indicator
fcd-block size pic x comp-x Block size for data records in bytes:
  • 0 - No blocking
  • 12 - 4096
  • 13 - 8192
  • 14 - 16384
  • 15 - 32768
  • 16 - 65536

For indexed and relative files, non-zero settings can degrade performance.

fcd-flags-1 pic x comp-x
  • Bit 7 - Mainframe compatibility bit. When set, file characteristics are not required to match those specified in program.
  • Bit 5 - READ and START operations will return the key (only) in the record area
  • Bit 1 - TRACE=ON
  • Bit 0 - Reserved
fcd-flags-2 pic x comp-x
  • Bit 0 - CONVERTDBSPACE=ON
fcd-mvs-flags pic x comp-x Mainframe emulation flags
  • Bit 2 - file is implicit file (ACCEPT or DISPLAY)
  • Bit 1 - AMODE(31) is on
  • Bit 0 - AMODE(24) is on
fcd-status-type pic x comp-x Status type:
  • Bit 7 - Set on for ANSI'85 COBOL file status by default, set off for ANSI'74 COBOL file status
  • Bit 6 - SPACEFILL=OFF
  • Bit 5 - STRIPSPACE=OFF
  • Bit 4 - EXPANDTAB=OFF
  • Bit 2 - INSERTTAB=ON
  • Bit 1 - INSERTNULL=ON
  • Bit 0 - Reserved

Bits 1 and 2 are set or unset by the File Handler at open time, depending on the settings of the N and T RTS switches. These bits can be set or unset after an OPEN operation to override the N and T RTS switches. Bit 3 means 'Use the other sort of line sequential record delimiter'.

fcd-other-flags pic x comp-x
  • Bit 7 - OPTIONAL file (OPEN INPUT)
  • Bit 6 - IGNORELOCK=ON
  • Bit 5 - Not OPTIONAL (OPEN I/O and EXTEND)
  • Bit 4 - Filename is EXTERNAL
  • Bit 3 - Reserved
  • Bit 2 - NODETECTLOCK directive enabled
  • Bit 1 - Multiple reel file (record sequential)
  • Bit 0 - Line advancing file (record sequential)
fcd-trans-log pic x comp-x
  • Bit 7 - OPENINPUTSHARED=ON
  • Bit 5 - READSEMA=OFF
  • Bit 4 - EXPANDPOSITIONING=ON
  • Bit 1 - FASTREAD=OFF
  • Bit 0 - SUPPRESSADV=ON
fcd-lock-types pic x comp-x
  • Bit 7 - Interlanguage locking (LOCKTYPE 1 or 2)
  • Bit 6 - SHARING WITH READ ONLY
  • Bit 5 - Separate lock file (LOCKTYPE 2)
  • Bit 4 - RUNITLOCKDETECT=OFF
  • Bit 3 - Use NFS file locking
  • Bit 2 - Use NFS file locking with HP compatibility
fcd-fs-flags pic x comp-x Fileshare flags:
  • Bit 7 - Transaction logging
  • Bit 3 - Trace OPEN and CLOSE operations
fcd-config-flags pic x comp-x
  • Bit 7 - WRITETHRU
  • Bit 6 - Use relative byte address
  • Bit 5 - Update current record pointer
  • Bit 4 - For FCD2 use fcd-reladdr-big for relative byte address instead of fcd-reladdr-offset
  • Bit 1 - Call status conversion routine
  • Bit 0 - Set if IGNORELOCK required
fcd-misc-flags pic x comp-x Miscellaneous flags:
  • Bit 7 - HOSTFD option (record areas allocated at OPEN time)
  • Bit 1 - File defined with EXTERNAL syntax
  • Bit 0 - File closed with lock
fcd-config-flags2 pic x comp-x
  • Bit 7 - Use EBCDIC collating sequence
  • Bit 6 - Set if file is to have WRITE AFTER ADVANCING
  • Bit 5 - Set if file is to have WRITE BEFORE ADVANCING
  • Bit 4 - ADV specified
  • Bit 3 - Ignore minimum length checking on variable-length files
fcd-lock-mode pic x comp-x Lock mode flags for shareable files:
  • Bit 7 - Lock on multiple records
  • Bit 6 - WRITELOCK directive enabled
  • Bit 5 - RETRYOPEN=ON
  • Bit 4 - SKIPLOCK =ON
  • Bit 3 - RETRYLOCK=ON
  • Bit 2 - Lock mode MANUAL
  • Bit 1 - Lock mode AUTOMATIC
  • Bit 0 - Lock mode EXCLUSIVE
fcd-shr2 pic x comp-x Miscellaneous flags:
  • Bit 1 - RETRYTIME=ON
  • Bit 0 - STARTUNLOCK=ON
fcd-nls-id pic xx comp-x NLS identifier
fcd-fs-file-id pic xx comp-x Reserved
fcd-retry-open-count pic xx comp-x RETRYOPEN count field
fcd-name-length pic xx comp-x Length of filename
fcd-idxname-length pic xx comp-x Reserved
fcd-retry-count pic xx comp-x Retry count (used when RETRYLOCK is on)
fcd-key-id pic xx comp-x Key-of-reference (indexed files), used for random READ operations. To specify the prime key, set this field to zero. For example, to specify the first alternate key defined, use a value 1; the second alternate key defined use value 2.
fcd-line-count pic xx comp-x

Line count (sequential files): the number of lines to skip when writing a file. For example:

WRITE AFTER ADVANCING line-count LINES

fcd-use-give pic xx comp-x Reserved
fcd-key-length pic xx comp-x Effective key length. When using a START operation on indexed files, you can specify only the leading part of a key instead of the whole key. You should set this field to the number of bytes to be used in the comparison. It must be greater than zero, and no bigger than the key being used.
fcd-current-rec-len FCD2: pic x(2) comp-x FCD3: pic x(4) comp-x Current record length (in bytes)
fcd-min-rec-length pic x(4) comp-x Minimum record length (in bytes)
fcd-max-rec-length pic x(4) comp-x Maximum record length (in bytes)
fcd-session-id pic x(4) comp-x Reserved
fcd-reladdr-offset FCD2: pic x(4) comp-x FCD3: pic x(8) comp-x Relative byte address. (See also fcd-config-flags, bit 4). The value of this field is undefined following the OPEN statement.
fcd-reladdr-big pic x(8) comp-x An eight-byte relative byte address. For FCD2, this is a separate field. For FCD3, it redefines fcd-reladdr-offset. Provided for compatibility between FCD2 and FCD3.
fcd-max-rel-key pic x(8) comp-x Maximum size of relative key
fcd-relative-key pic x(8) comp-x Relative key.

This field is also used, for indexed files, to hold the number of records in the file. It is set following an OPEN.

fcd-handle pointer File handle
fcd-record-address pointer Pointer to the record area
fcd-filename-address pointer Pointer to the filename area
fcd-idxname-address pointer Reserved
fcd-key-def-address pointer Pointer to key definition block
fcd-col-seq-address pointer Pointer to a collating sequence (null if none is used)
fcd-fildef-address pointer Reserved
fcd-dfsort-address pointer Reserved