J3/17-133 To: J3 From: Malcolm Cohen Subject: FILE= and STATUS= Date: 2017 February 16 1. Introduction There is a mistake in 17-007 engendered by the fact that the rules for combining FILE= and STATUS= in the OPEN statement are partly (mostly) in 12.5.6.2 Syntax (where I did not find them), and partly in 12.5.6.10 FILE= specifier in the OPEN statement (which is where I expected them). The rule in 12.5.6.10 specifies requirements for STATUS= for the case when FILE= does NOT appear, and the unit is not connected to a file. I do not understand why this rule should be (a) separate from the other rules for combining FILE= and STATUS=, and (b) why, if it is going to be separate, it would belong in FILE= at all. At a minimum, the mistake I made (in the STATUS= subclause) needs to be repaired, with a cross-reference to where the rules are. I would highly recommend that the rules for combining FILE= and STATUS= should be in the same place. That place would appear to me to be the FILE= subclause, but in the Syntax subclause (where the majority are now) would still be better than having them split across multiple subclauses. Finally, 12.5.6.2 Syntax also contains rules for NEWUNIT= (at p2). I also think that these are misplaced, and in this case I think they belong in the NEWUNIT= clause. Optional edits are included for moving these. 2. Minimum edits to 17-007 [232:20] 12.5.6.18 STATUS= specifier in the OPEN statement. p3, Delete the sentence "SCRATCH shall not be specified if the FILE= specifier appears." [232:22+] Same subclause, after p3, insert new note "NOTE 12.20a SCRATCH cannot be specified if the FILE= specifier appears (\ref...)." where "\ref..." is the location of the normative text that supports this note (currently 12.5.6.2 Syntax, but if we move that text it will be 12.5.6.10 FILE= specifier in the OPEN statement). 3. Recommended cosmetic edit [228:31] 12.5.6.2 Syntax, change the title of this subclause to "Syntax of the OPEN statement". {Makes it easier to cross-link, and more explanatory when quoting.} 4. Edits for combining the rules that affect combining FILE= and STATUS= ALTERNATIVE ONE (recommended): [229:26-28] 12.5.6.2 Syntax, p1, Delete entire p1 "If the STATUS= specifier ... unit exists.". {Text will be reinstated verbatim in the FILE= subclause.} [231:3] 12.5.6.10 FILE= specifier in the OPEN statement, p1, Before "If this specifier is omitted and", insert (move) the last sentence of this paragraph "The interpretation of case is processor dependent." (this sentence should immediately follow the thing it is talking about, i.e. it is currently misplaced). Then, insert a paragraph break, then the text from 229:26-29 that we deleted, changing "the FILE= specifier" to "this specifier", thrice, finally not forgetting to delete the final sentence which we just inserted (moved). This makes the whole subclause read "The value of the FILE= specifier is the name of the file to be connected to the specified unit. Any trailing blanks are ignored. The file-name-expr shall be a name that is allowed by the processor. The interpretation of case is processor dependent. If the STATUS= specifier has the value NEW or REPLACE, this specifier shall appear. If the STATUS= specifier has the value SCRATCH, this specifier shall not appear. If the STATUS= specifier has the value OLD, this specifier shall appear unless the unit is connected and the file connected to the unit exists. If this specifier is omitted and the unit is not connected to a file, the STATUS= specifier shall be specified with a value of SCRATCH; in this case, the connection is made to a processor-dependent file." ALTERNATIVE TWO: [229:26-28] 12.5.6.2 Syntax, p1, append sentence currently in the FILE= subclause, changing "this" to "the FILE=": "If the FILE= specifier is omitted and the unit is not connected to a file, the STATUS= specifier shall be specified with a value of SCRATCH; in this case, the connection is made to a processor-dependent file." This makes that paragraph read: "If the STATUS= specifier has the value NEW or REPLACE, the FILE= specifier shall appear. If the STATUS= specifier has the value SCRATCH, the FILE= specifier shall not appear. If the STATUS= specifier has the value OLD, the FILE= specifier shall appear unless the unit is connected and the file connected to the unit exists. If the FILE= specifier is omitted and the unit is not connected to a file, the STATUS= specifier shall be specified with a value of SCRATCH; in this case, the connection is made to a processor-dependent file." {Identical to the "new p2" of ALTERNATIVE ONE except for "this specifier" vs "the FILE= specifier".} [231:3-5] 12.5.6.10 FILE= specifier in the OPEN statement, p1, delete that sentence "If this ... processor-dependent file." This makes the whole subclause read: "The value of the FILE= specifier is the name of the file to be connected to the specified unit. Any trailing blanks are ignored. The file-name-expr shall be a name that is allowed by the processor. The interpretation of case is processor dependent. {Identical to the "new p1" of ALTERNATIVE ONE.} 4. Optional edit for NEWUNIT= [229:29-31] 12.5.6.2 Syntax, p2, delete entire paragrah "If the NEWUNIT= ... be preconnected." {This will appear, mutated, in the NEWUNIT= subclause.} [231:14-] 12.5.6.12 NEWUNIT= specifier in the OPEN statement, before p1, insert the first sentence of the text we just deleted, changing "the NEWUNIT=" to "this", as a new p1: "If this specifier appears in an OPEN statement, either the FILE= specifier shall appear, or the STATUS= specifier shall appear with a value of SCRATCH." [231:19] Same subclause, p2, append second sentence of the text we just deleted, unmodified, "The unit identified by a NEWUNIT value shall not be preconnected." {This is where all the other blather about the NEWUNIT value appears.} ===END===