Output message formatting options
MFS provides three message formatting options for output data. The option selected determines how the data is formatted and governs the way in which the application program builds the output message.
Option 1, 2, or 3 is specified in the OPT= operand of the MOD MSG statement.
Segments inserted by the application program must be in the sequence defined to the MFS Language utility program. Not all segments in a logical page must be present, but be careful when you omit segments. An option 1 or 2 segment can be omitted if all subsequent segments to the end of the logical page are omitted; otherwise, a null segment (X'3F') must be inserted to indicate segment position. Option 3 output message segments must include a 2-byte relative segment number.
Message fields in option 1 and 2 output segments are defined as fixed-length and fixed position. Fields can be truncated or omitted by two methods:
- One method is by inserting a short segment.
- The other method is by placing a NULL character (X'3F') in the field. Fields are scanned left to right for a null character; the first null encountered terminates the field. If the first character of a field is a null character, the field is effectively omitted, depending on the fill character used. Positioning of all fields in the segment remains the same regardless of null characters. Fields truncated or omitted are padded as defined to the MFS Language utility.
Message fields in option 3 segments can be placed in any order and with any length that conforms to the segment size restriction. Short fields or omitted fields are padded as defined to the MFS Language utility. Each field must be preceded by a 4-byte field prefix of the same format provided by MFS for option 3 input fields.
While option 3 fields do not have to be in sequence in the output segment, all fields must be contiguous in the segment; that is, the field prefix of the second field must begin in the byte beyond the first field's data. Null characters in option 3 fields have no effect on the data transmitted to the device. Like other nongraphic characters, they are replaced with a blank.
Option 1 or 2—output segment example
Definition Output data length
Segment
Field, length=10 4
Field, length=20 field omitted
Field, length=5 5
Field, length=15 15
CONTENTS |54|0|0| DATA 1|*| |* | DATA 3 | DATA 4|
--------------------------------------------------------
LENGTH 2 1 1 4 1 5 20 5 15
Option 3—output segment example
CONTENTS |42|0|0|04|08|04| DATA 1|09|34| DATA 3 |19|39| DATA 4|
---------------------------------------------------------------
LENGTH 2 1 1 2 2 2 4 2 2 5 2 2 15