FILEDEF
Format
Purpose
Use the FILEDEF command to define CMS format files and spool files.
Application programs usually require some setting up before you can start and run them. The FILEDEF command is one of the preliminary commands issued to prepare a program for execution. You enter it to define CMS format files and spool files used by the program.
Operands
- ddname
- The name of the file, as referred to in your program. The ddname can contain one to eight alphanumeric characters. However, the first one must be alphabetic or national.
- *
- If you specify an asterisk (*) instead of a ddname and follow it with the CLEAR operand, all file definitions that you did not enter with the PERM option will be cleared.
- CLEAR
- Removes any existing definition for the specified ddname that is owned by the current task. You should clear ddnames before defining them to make sure the ddname does not already exist. Doing that cancels any operations previously defined with the ddname.
- PRinter
- Represents the spooled printer, which you must have defined at virtual address 00E.
- OPTCD j
- When the virtual printer is a 3800, j indicates to QSAM and BSAM that the output data line's first byte will contain a table reference character (TRC). This TRC selects a character arrangement table to use in printing the data line. The TRC can be alone or with other ANSI control characters.
- PUnch
- Represents the spooled punch, which you must have defined at virtual address 00D.
- Reader
- Represents the spooled card reader, which you must have defined at virtual address 00C. (I/O to the card reader must not be blocked.)
- DUMMY
- Indicates that no real I/O takes place for the data set.
- DISK
- Specifies that the virtual I/O device is a disk. fn and ft are CMS fields. If you omit DISK fn ft, the default is FILE ddname A1.
- DISP MOD
- Positions the read/write pointer after the last record in a disk file. Use this option only when you are adding records to the end of a file. That file must be on a disk accessed as read/write. The disk cannot be an extension of another disk. If so, it would be read/only, and you could not write to it.
- DSORG PS
- Specifies that the data set has a physical, sequential (PS) organization.
Options
- BLOCK nnnnn
- BLKSIZE nnnnn
- Specifies the maximum block length in bytes. For fixed length records, this is the record length. For variable length records, this gives the maximum logical record length (up to 32756 bytes, plus 4 bytes for a block descriptor word). For undefined length records, this value can be altered by the problem program. It can be inserted directly into the data control block or specified in the length operand of a READ/WRITE macro.
- CHANGE
- Combines definitions for an existing ddname with new ones when you enter a new FILEDEF for that same ddname.
All options from both definitions are merged. A new definition for a particular option replaces the
original definition.
The CHANGE option is not valid when the new FILEDEF is issued for a ddname that another task has already issued a FILEDEF for, or when the associated file has already been opened.
- NOCHANGE
- Retains the current file definition, if one exists, for a specified ddname. With this option, the system stops further processing (error checking, scanning, and similar functions) for new FILEDEF commands with the same ddname.
- LRECL nnnnn
- Specifies the length, in bytes, of each fixed length logical record or the maximum length, in bytes, for variable length logical records. This value should not exceed 32760 bytes for fixed length records or 32756 (including four bytes for a record descriptor word) for variable length records.
- PERM
- Retains the current file definition until it either is explicitly cleared or is changed by a new FILEDEF command with the CHANGE option. If you do not specify PERM, the definition is cleared when you enter FILEDEF * CLEAR.
- RECFM
- Represents the record format of the file, where a can be one of these:
- Type is:
- The file contains:
- F
- Fixed length records
- FA
- Fixed length records with American National Standards Institute (ANSI) characters
- FB
- Fixed length, blocked records (not for use with READER devices)
- FBA
- Fixed length, blocked records with ANSI characters
- V
- Variable length records
- VA
- Variable length records with ANSI characters
- VB
- Variable length, blocked records (not for use with READER devices)
- VBA
- Variable length, blocked records with ANSI characters
- U
- Records of an undefined length
- UA
- Records of an undefined length with ANSI characters.
For more information on using this command and its operands and options, see z/VM: CMS Commands and Utilities Reference
Messages
- GCTFLD001E Invalid option 'option' RC=24
- GCTFLD002E Invalid parameter 'parameter' in the option 'option' field RC=24
- GCTFLD003E 'option' option specified twice RC=24
- GCTFLD004E 'option1' and 'option2' are conflicting options RC=24
- GCTFLD005S Virtual storage capacity exceeded RC=104
- GCTFLD006E Invalid parameter 'parameter' RC=24
- GCTFLD011E Invalid character in fileid 'fn ft' RC=20
- GCTFLD017E Disk mode not accessed RC=36
- GCTFLD021E Invalid mode 'mode' RC=24
- GCTFLD023E No file type specified RC=24
- GCTFLD301E Invalid device 'device name' RC=24
- GCTFLD302E Parameter missing after DDNAME RC=24
- GCTFLD303I No user defined FILEDEFS in effect
- GCTFLD304I Invalid CLEAR request
- GCTFLD320E Error during FILEDEF CLEAR processing, DCBs not closed RC=40
For more information on messages, see z/VM: Other Components Messages and Codes.
