J3/01-155 Date: 3 March 2001 To: J3 From: John Reid Subject: Interpretation 20 (Execution of a WHERE statement within a WHERE construct) Here is a draft answer for interp. 20. I sent earlier drafts to the WG5 list for comments and would like thank those that helped me get to this version, specially Niki Reid. .............................................................. NUMBER: 000020 TITLE: Execution of a WHERE statement within a WHERE construct KEYWORDS: WHERE statement, WHERE construct DEFECT TYPE: STATUS: J3 consideration in progress QUESTION: 7.5.3.2 [113:17-19] indicates that: Upon execution of a WHERE statement or a WHERE construct statement that is part of a , the pending control mask is established to have the value m .AND.(.NOT. mask-expr). c [112:41-45] indicates that: Upon execution of an ENDWHERE statement, the control mask and pending control mask are established to have the values they had prior to the execution of the corresponding WHERE construct statement. Following the execution of a WHERE statement that appears as a , the control mask is established to have the value it had prior to the execution of the WHERE statement. Notice that after execution of an ENDWHERE statement, the pending control mask is established to have the value it had prior to the execution of the corresponding WHERE construct statement, but the same is not the case for the pending control mask established by the execution of a WHERE statement that appears as a . According to this, the output of the following program PROGRAM P INTEGER :: A(2) = 0, B(2) = 0 WHERE((/.TRUE.,.TRUE./)) WHERE((/.TRUE.,.FALSE./)) A = 1 ELSEWHERE A = 2 END WHERE PRINT *, A WHERE((/.TRUE.,.TRUE./)) WHERE((/.TRUE.,.FALSE./)) B = 1 END WHERE ELSEWHERE B = 2 END WHERE PRINT *, B END PROGRAM P will be 1 2 1 0 Was this difference in behaviour intended by the committee? ANSWER: No. It was intended that WHERE() should have the same interpretation as WHERE() END WHERE The output from the above program should be 1 0 1 0 An edit is supplied to correct the text. EDIT: Page 113, subclause 7.5.3.2. In the first line of the paragraph following NOTE 7.48 [113:17] delete 'a WHERE statement or'; after the paragraph [113:20+] add the new paragraph: Upon execution of a WHERE statement that is part of a where-body-construct, the control mask is established to have the value .AND.. The pending mask is not altered. SUBMITTED BY: Henry Zongaro HISTORY: 98-149 m145 Submitted