• Aucun résultat trouvé

INPUT/OUTPUT FACILITIES

Dans le document LANGUAGE MANUAL FORTRAN-IO (Page 188-191)

SUBl o ERRORS DETECTED

C.4 INPUT/OUTPUT FACILITIES

FOROTS utilizes monitor-buffered I/O during all modes of access. Display devices are supported in dump mode.

Formatted text is handled in ASCII line mode; unformatted files are accessed as FORTRAN binary files.

I/O data channels and access modes are described, individually, in the following paragraphs.

C.4.1 Input/Output Channels

Fifteen software channels (1-15) are available in I/O operations. Software channel 0 is reserved for the following system functions:

1. the printing of error messages, and

2. GETSEG UUO operations (loading and initialization of FOROTS).

Software channels 1 through 15 are available for user program data transfer operations. When a request is made for a da ta channel, a search table is scanned, starting at channell, until a free channel is found. The first free channel is assigned to the requesting program; on completion of the assigned transfer, control of the software channel is returned to FOROTS.

C.4.2 File Access Modes

Data may be transferred between processor storage and peripheral devices in two major modes:

1. Sequential and 2. Random

C.4.2.1 Sequential Transfer Mode - In sequential data transfer operations, the records involved are transferred in the same order as they appear in the source file. Each I/O statement executed in this mode transfers the record immediately following the last record transferred from the accessed source file. A special version of the sequential mode (referred to as Append) is available for output (write) operations. The special Append sequential mode permits the user to write a record immediately after the last logical record of the accessed file. During an Append operation, the records already in the accessed file remain unchanged; the only function performed is the appending of the transferred records to the end of the file.

Transfer modes (other than default mode) must be specified by setting the ACCESS option of an OPEN statement to one of several possible arguments. For the sequential mode, the arguments are:

ACCESS = SEQIN (sequential read-only mode) ACCESS

=

SEQOUT (sequential write-only mode)

ACCESS

=

SEQUINOUT (sequential read followed by a sequential write) ACCESS

=

APPEND (sequential Append mode)

C-3 January 1974

C.4.2.2 Random Access Mode - This transfer mode permits records to be accessed and transferred from a source me in any desired order. Random access transfers, however, may he made between processor core and a device which permits random addressing operations (e.g., disk) and to files which have been set up for random access. Files for random access must contain a specified number of identically-sized records which may be accessed, individually, by a record number.

Random access transfers may be carried out in either a read/write mode or a special read-only mode. The read-only mode is designed to permit a large number of users to read, simultaneously, the same files; this enables a (single) data base to be set up for access by a large group of users. Transfer modes (other than system default mode) must be speCified by setting the ACCESS option of an OPEN statement to one of several possible arguments. For the random access mode, the arguments are:

ACCESS = RANDOM (random read/write mode) ACCESS = RANDIN (random special read-only mode) C.s ACCEPTABLE TYPES OF DATA FILES AND THEIR FORMATS

The types of data files which are acceptable to FOROTS are described, individually, in the following paragraphs.

C.S.1 ASCII Data Files

Each record within an ASCII data me consists of a set of contiguous 7-bit characters; each set is terminated by a vertical paper-motion character (Le., Form Feed, Vertical Tab, or Line Feed). All ASCII records start on a word boundary; the last word in a record is padded with nulls, if necessary, to ensure that the record also ends on a word boundary. Logical records may be split across storage blocks. There is no implied maximum length for logical records.

NOTE

On sequential input, FOROTS does not require conformation to word boundaries, it reads what it sees; however, any file that is written by FOROTS will conform to the foregoing format requirements.

C.5.2 ASCII Data Files with Line Sequence Numbers

The addition of line sequence numbers to an ASCII data file is performed according to the following rules:

a. Each line sequence number consists of five ASCII decimal digits which are stored in the first word of the line. Each sequence number is right-justified within the first word location with leading Os.

b. Bit 35 of the line sequence number word must be set to 1.

c. The first character following a line sequence number is interpreted by FOROTS in the following manner:

1. On input, if the character is either a tab or a blank, it is skipped and the next character is processed; all other characters are processed.

NOTE

The D delimiter used in BASIC data files is treated as a data character and is passed to the user program.

C-4 January 1974

2. On output, the line sequence number is always followed by a tab. FOROTS always adds line sequence numbers to ASCII output files when in this mode. Sequence numbers start at 1 and are incremented by 1 ( default value) unless another increment is specified by the user (via an OPEN statement). The maximum line sequence number is 99999; if this number is reached, the count is restarted at 1.

C.S.3 F:ORTRAN Binary Data Files

Each logical record in a FORTRAN binary data file contains data which may be referred to by either a READ or a WRITE statement in the program being executed. A logical record is preceded by a control word and may have one or more control words embedded within it. In FORTRAN binary data files there is no relationship between logical records and physical block sizes. When stored, each logical record follows immediately the previous record on the storage medium. There is no implied maximum length for logical records.

C.S.4 Mixed Mode Data Files

FOROTS permits files containing both ASCII and binary data records to be read. Mixed files may be accessed in either sequential or random access mode. Logical ASCII and binary records have the same format as described in the preceding paragraphs.

C.S.S Image Binary Files

The image binary data transfer mode is a buffered mode in which data is transferred in a blocked format consisting of a word count located in the right half of the first data word of the buffer followed by n number of 36-bit data words. The devices which permit image binary data transfers and the form in which the data is read or written are:

Device Card Punch

Card Reader

Magnetic Tape

Paper Tape Punch

Paper Tape Reader

Plotter

Data Fonns

In image binary mode, each buffer contains three 12-bit bytes. Each byte corresponds to one card column. Since there is room for 81 columns in the buffer (3 X 27) and there are only 80 columns on a card, the last word contains only 2 bytes of data; the third byte is thrown away. Image binary causes exactly one card to be punched for each output. The CLOSE punches the last partial card and then punches an EOF card.

All 12 punches in all 80 columns are packed into the buffer as 12-bit bytes. The first 12-bit byte contains column l. The last word of the buffer contains columns 79 and 80 as the left and middle bytes, respectively. Cards are not split between two buffers.

Data appears on magnetic tape exactly as it appears in the buffer. No processing or checksumming of any kind is performed by the service routine. The parity checking of the magnetic tape system is sufficient assurance that the data is correct. Normally, all data, both binary and ASCII, is written with odd parity and at 800 bits per inch unless changed by the installation.

Binary words taken from the output buffer are split into six 6-bit bytes and punched witl.

the eighth hole punched in each frame. There is no format control or checksumming performed by the I/O routine. Data punched in this mode is read back by the paper tape reader in the same mode.

Characters not having the eighth hole punched are ignored. Characters are truncated to six bits and packed six to the word without further processing. This mode is useful for reading binary tapes having arbitrary blocking format.

Six 6-bit characters per word are transmitted to the plotter exactly as they appear in the buffer.

C-5 January 1974

Dans le document LANGUAGE MANUAL FORTRAN-IO (Page 188-191)