07-266R1 To: J3 From: Dick Hendrickson Subject: Interpretation: Can a READ statement change the unit value? Date: 2007 August 8 NUMBER: F03/0096 TITLE: Can a read statement change the unit value? KEYWORDS: Read statement, unit value DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: Is it allowed to change the value of a variable which supplies the unit number to an read statement? Page 219:16 says the value of any input/output specifier shall not depend on any input-item. If you trace back, the unit= is a specifier in a READ statement. Note 9.40 on page 196 gives the example READ(N) N, X(N) and discusses how the changes in N work. In F77 the similar example had READ(3). In Fortran 90 this was changed to READ(N) (on page 126) and was normative. In F95 the example was changed to a non-normative note. The words prohibiting the example usage appear to be new to F03. ANSWER: Yes, the example was intended to be allowed. The restriction on page 219 is overly restrictive. Edits will limit the restriction to "output items" in the specifier list and the Format. These are the items that the processor will usually reference during actual input/output transfers. EDITS: [219:16] In the 6th paragraph of 9.11 replace "The value of a specifier" with "The value of a FMT=, ID=, IOMSG=, IOSTAT= or SIZE= specifier" SUBMITTED BY: Dick Hendrickson HISTORY: 07-266 m181 F03/00xx Submitted 07-266R1 m181 Draft answer