For information on the syntax of the EDIT data specification, refer to Data specification options.
|
The iteration factor specifies that the associated format item or format list is used n successive times. A zero or negative iteration factor specifies that the associated format item or format list is skipped and not used (the data-list item is associated with the next data-format item).
If an expression is used to represent the iteration factor, it is evaluated and converted to an integer, once for each set of iterations.
The associated format item or format list is that item or list of items immediately to the right of the iteration factor.
The first data-format item is associated with the first data-list item, the second data-format item with the second data-list item, and so on. If a format list contains fewer data-format items than there are items in the associated data list, the format list is reused. If there are excessive format items, they are ignored.
Suppose a format list contains five data-format items and its associated data list specifies ten items to be transmitted. The sixth item in the data list is associated with the first data-format item, and so forth. Suppose a format list contains ten data-format items and its associated data list specifies only five items. The sixth through the tenth format items are ignored.
If a control-format item is encountered, the control action is executed.
The PAGE and LINE control-format items can be used only with PRINT files and, consequently, can appear only in PUT statements. The SKIP, COLUMN, and X-format items apply to both input and output.
The PAGE, SKIP, and LINE format items have the same effect as the corresponding options of the PUT statement (and of the GET statement, in the case of SKIP), except that the format items take effect when they are encountered in the format list, while the options take effect before any data is transmitted.
The COLUMN format item cannot be used in a GET STRING or PUT STRING statement.
For the effects of control-format items when specified in the first GET or PUT statement following the opening of a file, see OPEN statement.
A value read into a variable can be used in a format item that is associated with another variable later in the data list.
get edit (M,String_A,I,String_B)(F(2),A(M),X(M),F(2),A(I));
In this example, the first two characters are assigned to M. The value of M specifies the number of characters assigned to String_A and the number of characters being ignored before two characters are assigned to I, whose value is used to specify the number of characters assigned to String_B.
The value assigned to a variable during an input operation can be used in an expression in a format item that is associated with a later data item. An expression in a format item is evaluated and converted to an integer each time the format item is used.
The transmission is complete when the last data-list item has been processed. Subsequent format items, including control-format items, are ignored.