Skip to content

Input/output options for directives

Each input/output directive has options that may be used to help specify what record is to be affected, where the data is to come from or go to, and what to do in case of problems. These are referred to as I/O options and are discussed in depth with each input/output directive in the Thoroughbred Basic Language Reference. They are listed here to show the capabilities available to the programmer with each read or write of data.

Record Specification

IND=nn
Specifies the index number of the record to access in an INDEXED file. If IND=nn and KEY=string are specified, IND=nn is ignored.
KEY=string
Specifies the key value of the record to access in a DIRECT file. If IND=nn and KEY=string are specified, IND=nn is ignored.
SRT=sortname
Specifies which sort key is to be used with an MSORT file.

Branching Specification

DOM=lineref
Specifies the program line number to branch to if an attempt is made to access a record using KEY= and no such key value is found (ERR=11). DOM= takes precedence over ERR= in the same directive.
END=lineref
Specifies the program line number to branch to if this directive senses the end of file (ERR=02). END= takes precedence over ERR= in the same directive. Processing a file backwards (PREAD or PEXTRACT) results in an end of file condition when the physical beginning of the file is reached.
ERR=lineref
Specifies the program line number to branch to if an error is produced by this directive.

Verification Specification

LEN=min,max
Specifies the minimum and maximum number of characters to be accepted by this input directive; less than minimum or more than maximum results in an ERR=48.
[-]range
Specifies the minimum and maximum numeric values to be accepted by this input directive; numbers outside the range results in an ERR=48. Unsigned range indicates the range is 0 (zero) through range; negative range indicates the range is negative range through positive range.
string=lineref
Specifies the program line number to branch to if the specific string is entered in response to this (input) directive.

Miscellaneous Specification

IOL=lineref
Specifies a program line number containing an IOLIST directive that defines a variable list to be used when inputting or outputting data from/to a record with this directive.
TBL=lineref
Specifies the program line number of the TABLE directive to be used for code conversion after input or before output of data by this directive.
TIM=nn
Specifies the number of seconds allowed to elapse without any data transfer before an ERR=0 is generated by this (input) directive. Actual time may vary by -1/+0 seconds.
SIZ=max
Specifies the integer maximum number of characters to be transferred by this (input) directive before an end of record is forced. Following data is not lost and can be retrieved by additional (input) directives. The end of record terminator is the same as the F5 key (setting CTL system variable to 5).
ERC=numval
Specifies a programmer-defined value. This clause enables programmers to define and manage processing errors that occur within a directive. It provides a structured programming alternative to the ERR= clause. ERC= is valid anywhere ERR= is valid.

The PRINT directive offers additional capability with its data masking functions. Refer to the chapter on Data Representation and the PRINT directive in the Thoroughbred Basic Language Reference.

From the Thoroughbred Basic Developer Guide, version 8.9.1. Open this page in the PDF