Regularize I/O Keywords Technical Specification and Syntax To: J3 From: Craig T. Dedo Date: October 26, 2000 Subject: Regularize I/O Keywords - Technical Specification and Syntax 1. Rationale Users often would like to have complete regularity between the keywords for the OPEN statement and the keywords that are allowed for the READ and WRITE statements. In addition, this is an integration issue that arises out of the user-defined derived-type input/output (DTIO) feature. If J3 approves regularizing input/output (I/O) keywords, it will be much easier to make sure that DTIO is correctly designed and the normative text correctly written. 2. Technical Specification and Syntax This paper regularizes the concept of modes for I/O connections. The state of a mode may be explicitly specified by a keyword specifier or implicitly specified if the corresponding keyword is absent. This feature allows a user to specify the values for the following modes in the OPEN statement or in READ and WRITE statements. 1. Blank interpretation 2. Character string delimiter 3. Padding of input records 4. Sign presence or absence The states of I/O modes are determined according to the following hierarchical rules of precedence. 1. The initial state for a mode is established by the most recently executed OPEN statement on that unit. The modes for an internal file or pre-connected file have the same initial states that would be established if an OPEN statement was executed and the corresponding keyword was absent. 2. The state of a mode established by an OPEN statement may be temporarily changed by a corresponding keyword in a data transfer statement, during the execution of that data transfer statement. 3. The state of a mode established by an OPEN statement or a data transfer statement may be temporarily changed by a format edit descriptor. The modes in effect immediately before a data transfer statement is executed are restored when the data transfer statement terminates. A child data transfer statement in a DTIO statement shall inherit the states of the modes in effect in the parent data transfer statement. Users shall be able to use the BLANK=, DELIM=, and PAD= keywords in READ and WRITE statements. The BLANK=, DELIM=, and PAD= keywords shall have the same values in READ and WRITE statements that they have in the OPEN statement. Users shall be able to use a SIGN= keyword in the OPEN, READ, WRITE, and INQUIRE statements. When used in an OPEN, READ, or WRITE statement, the SIGN= keyword shall set or change the sign mode. It shall evaluate to one of the values of PLUS, SUPPRESS, or PROCESSOR_DEFINED. The SIGN= keyword values shall correspond to the sign edit descriptors SP, SS, and S respectively. When used in an INQUIRE statement, the SIGN= keyword shall assign the value of the current sign mode to the scalar default character variable that is associated with the SIGN= keyword. [End of J3 / 00-316r1]