An optional END may be used after the last data item. If USING is specified, then the effect of the END is quite different than if USING is not specified.
An END after the last item in an OUTPUT USING statement will have the following effect:
1) If the last image specifier does not have an output item (X, /, @, L, and "literals"), then EOL is suppressed, including alternate EOLs specified by + or -, and no EOI is sent. Exception 1: If the IMAGE specifier is L and END is specified in the ASSIGN then EOI is sent with the EOL whenever the EOL is sent.
2) If the last image specifier does have an output item (K, H, D, Z, *, A, B, W, and Y) then EOL is unaffected and EOI is sent with the last byte sent. Exception 2.1: If END is also used in the ASSIGN statement then two EOIs are sent, one with the last output item and one with the EOL. This is the exception that HTBasic does not emulate; the general rule 2 is followed. Exception 2.2: If the last output item is a string with a length of zero, and the image specifier is K, and # has suppressed the EOL, then no EOI is sent. As an example, this statement will output one character, "A", with no EOI:
OUTPUT 717 USING "K,K,#";"A","" END
3) If the last image specifier changes the default EOL (#, +, and -), then use the next to last specifier to determine whether to use rule 1 or 2, above.