Format 5 (TRANSACTION Subfile) ->->---WRITE SUBFILE record-name-1--*-----------------*-------> *FROM identifier-1* ->----*--------------------------------*---------------------> *-FORMAT-*----*-*-identifier-2-*-* *-IS-* *-literal-1----* ->----*----------------------------------*-------------------> *-TERMINAL-*----*-*-identifier-3-*-* *-IS-* *-literal-2----* ->----*------------------------------------------*-----------> *-*-INDICATOR--*--*-----*--identifier-4----* *-INDICATORS-* *-IS--* *-INDIC------* *-ARE-* ->----*-----------------------------------------*------------> *-INVALID--*-----*-imperative-statement-1-* *-KEY-* ->----*--------------------------------------*-*---------*---><- *NOT INVALID*---*imperative-statement-2* *END-WRITE* *KEY*
When you specify the SUBFILE phrase, it indicates that all formats referenced by the statement are subfiles.
When you specify SUBFILE, the RELATIVE KEY clause must have been specified on the SELECT clause for the file being written. The record written to the subfile is the record in the subfile identified by the format name that has a relative record number equal to the value of the RELATIVE KEY data item.
The TERMINAL phrase specifies which program device's subfile is to have a record written to it. If you specify the TERMINAL phrase, literal-2 or identifier-3 must refer to a workstation associated with the TRANSACTION file. If literal-2 or identifier-3 contains blanks, the TERMINAL phrase is treated as if it was not specified. The workstation specified by the TERMINAL phrase must have been acquired either explicitly or implicitly.
If you omit the TERMINAL phrase, the subfile used is the subfile associated with the default program device.
The contents of literal-2 or identifier-3 must be the name of a work station previously acquired, either implicitly or explicitly, by the file. If you specify literal-2, it must be nonnumeric and 10 characters or less in length. If you specify identifier-3, it must refer to an alphanumeric data item 10 characters or less in length. A value of blanks is treated as if the TERMINAL phrase were omitted.
Identifier-4 must be either an elementary Boolean data item specified without the OCCURS clause, or a group item that has elementary Boolean data items subordinate to it.
The INVALID KEY condition exists if a record is already in the subfile with that record number, or if the relative record number specified is greater than the maximum allowable subfile record number.
The INVALID KEY phrase should be specified in the WRITE SUBFILE statement for all files for which an appropriate USE procedure is not specified.
Click here for further information about the invalid key condition.
The NOT INVALID KEY phrase allows you to specify procedures that will be performed when an invalid key condition does not exist for the WRITE statement.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.