To: J3 J3/21-177 From: Van Snyder Subject: Scale factor and defined input/output Date: 2021-September-26 Reference: 21-007r1 1. Introduction --------------- There is no clear and explicit specification whether the scale factor established by a P edit descriptor in a parent data-transfer statement persists into a child data transfer statement. There is a statement in subclause 12.5.2 "Connection modes" that the OPEN statement cannot specify the scale factor, and that it is implicitly zero. There are three possibilities: 1. It is "implicitly" zero at the beginning of execution of every data-transfer statement. 2. It is "implicitly" zero at the beginning of execution of every parent data-transfer statement, continues to have the value established by a P edit descriptor when execution of a child data-transfer statement begins execution, and any change established during a child data-transfer statement persists when control returns to the parent data-transfer statement. 3. It's processor dependent. There are several things that might be done. No matter which (if any) is done, the following would be helpful: [260:24- 13.4 Interaction between input/output list and format, after NOTE 4] Insert a note: "NOTE Because reversion of format control does not affect changeable modes, the scale factor persists. Example: The following format specification 10 FORMAT ( F10.6, 2P, F10.6 ) with the output statement WRITE ( *, 10 ) 0.125, 0.125, 0.375, 0.375 produces the following output: 0.125000 12.500000 37.500000 37.500000 " 2. First strategy ----------------- Specify explicitly that the value of the scale factor is zero at the beginning of execution of every data-transfer statement. [218:1 12.5.2p3 Connection modes] Replace the paragraph: "The scale factor is not a changeable mode of a connection. It cannot be specified in an OPEN statement. It is a changeable mode that has effect during execution of a single formatted data-transfer statement. It can only be specified by a P edit descriptor (13.8.5). It is implicitly zero at the beginning of execution of every formatted data-transfer statement." [273:13 13.8.5p1 P editing] The scale factor is not a changeable mode of a connection. In the first sentence, delete "for the connection". Insert sentences between the first and second: "The scale factor is a changeable mode that has effect during execution of a single data-transfer statement. It is implicitly zero at the beginning of execution of every data-transfer statement. If it is changed by a P edit descriptor, that value persists until completion of execution of that data-transfer statement, or until it is changed by a P edit descriptor. The value in effect when a child data-transfer statement (12.6.4.8) completes execution does not affect the value in effect during execution of a parent data-transfer statement (12.6.4.8)." [273:14+ 13.8.5p1 P editing] Insert a note: "NOTE Changing the value of the scale factor during execution of a child data-transfer statement does not change the value in effect during execution of a parent data-transfer statement." 3. Second strategy ------------------ Specify explicitly that the scale factor is zero at the beginning of execution of every parent data-transfer statement, continues to have the value established by a kP edit descriptor when execution of a child data-transfer statement begins execution, and any change established during a child data-transfer statement persists when control returns to the parent data-transfer statement. [218:1 12.5.2p3 Connection modes] Replace the paragraph: "The scale factor is not a changeable mode of a connection. It cannot be specified in an OPEN statement. It is a changeable mode that has effect during execution of a single formatted data-transfer statement. It can only be specified by a P edit descriptor (13.8.5). It is implicitly zero at the beginning of execution of every formatted parent data-transfer statement (12.6.4.8). The value established by a P edit descriptor in a parent data-transfer statement is the value of the scale factor when execution of a child data-transfer statement (12.6.4.8) begins. If the value is changed during execution of a child data-transfer statement, that value persists when control returns to the parent data-transfer statement." [273:13 13.8.5p1 P editing] The scale factor is not a changeable mode of a connection. In the first sentence, delete "for the connection". Insert sentences between the first and second: "The scale factor is a changeable mode that has effect during execution of a single data-transfer statement. It is implicitly zero at the beginning of execution of every parent data-transfer statement. If it is changed by a P edit descriptor, that value persists until completion of execution of that data-transfer statement, or until it is changed by a P edit descriptor. The value established by a P edit descriptor in a parent data-transfer statement (12.6.4.8) is the value of the scale factor when execution of a child data-transfer statement begins. If the value is changed during execution of a child data-transfer statement (12.6.4.8), that value persists when control returns to the parent data-transfer statement." [247:23+ R1231 ] Insert an alternative " <> SCALE = " [251:36+ after ROUND= specifier in the INQUIRE statement] insert a subclause "12.10.2.27a SCALE= specifier in the INQUIRE statement If the INQUIRE statement is executed while a parent data-transfer statement (12.6.4.8) is in execution, the value of the is the current value of the scale factor (13.8.5). Otherwise, the value is zero." 4. Third strategy ----------------- [218:1 12.5.2p3 Connection modes] Replace the paragraph: "The scale factor is not a changeable mode of a connection. It cannot be specified in an OPEN statement. It is a changeable mode that has effect during execution of a single formatted data-transfer statement. It can only be specified by a P edit descriptor (13.8.5). It is implicitly zero at the beginning of execution of every formatted parent data-transfer statement. Whether the value is zero at the beginning of execution of a child data-transfer statement, or the value established during execution of a parent data-transfer statement, is processor dependent. Whether the value established during execution of a child data-transfer statement persists as the value when control returns to the parent data-transfer statement is processor dependent." [273:13 13.8.5p1 P editing] The scale factor is not a changeable mode of a connection. In the first sentence, delete "for the connection". Insert sentences between the first and second: "The scale factor is a changeable mode that has effect during execution of a single data-transfer statement. It is implicitly zero at the beginning of execution of every parent data-transfer statement. If it is changed by a P edit descriptor, that value persists until completion of execution of that data-transfer statement, or until it is changed by a P edit descriptor. Whether the value established by a P edit descriptor in a parent data-transfer statement is the value of the scale factor when execution of a child data-transfer statement begins is processor dependent. If the value is changed during execution of a child data-transfer statement, whether that value persists when control returns to the parent data-transfer statement is processor dependent." [247:23+ R1231 ] Insert an alternative " <> SCALE = " [251:36+ after ROUND= specifier in the INQUIRE statement] insert a subclause "12.10.2.27a SCALE= specifier in the INQUIRE statement If the INQUIRE statement is executed while a parent data-transfer statement (12.6.4.8) is in execution, the value of the is the current value of the scale factor (13.8.5). Otherwise, the value is zero." [520:20+ A.2 Processor dependencies] Insert list items " o whether the value of the scale factor (13.8.5) at the beginning of execution of a child data-transfer statement (12.6.4.8) is zero or is the value established during execution of the parent data-transfer statement; o whether the value of the scale factor (13.8.5) when control returns from a child data-transfer statement (12.6.4.8) to a parent data-transfer statement is the value in effect when the child data-transfer statement began, or is the value in effect when the child data-transfer statement completed execution; "