Input message formatting options

MFS supports three message formatting options. The option selected determines how MFS interprets the MID definition and thereby formats the data into message fields for presentation to the application program.

The MID's MFLD statement or statements describes message fields in terms of:

  • Length
  • The device field from which input data is to be obtained
  • Literal data for message fields which will not or do not receive device data
  • Fill characters to use when the input data does not fill the message field
  • Field justification (left or right) or truncation (left or right) specifications
  • Whether the first 2 bytes of the field should be reserved for attribute data

The formatting option is specified in the MID's MSG statement (OPT=). The selection of the proper option for an application is a design decision that should be based on the complexity and variability of the device data stream, the programming language used, and the complexity of the program required to process the application under a given option. In the option descriptions, a NULL character is X'3F'.

MFS option 1

The effect of option 1 depends on whether a fill character of NULL has been defined. When no field in an option 1 message is defined to the MFS Language utility as having a fill character of NULL:

  • Messages always contain the defined number of segments.
  • Each segment is always of the defined length and contains all defined fields.
  • All fields are filled with data, data and fill characters, or fill characters.

When fields in an option 1 message are defined as having a fill character of NULL:

  • Each field with null fill and no input data from the device is eliminated from the message segment. If all fields in a segment are eliminated in this manner and no literals (explicit or default) are defined, the segment is eliminated; otherwise, the length of the segment is reduced and the relative position of succeeding fields in the segment is altered.
  • Fields with null fill that receive device data that does not fill the field are not padded—the number of characters received for the device field becomes the number of characters of the input data. This alters the length of the segment and the relative position of all succeeding fields in the segment.

MFS option 2

Option 2 formatting is identical to option 1 unless a segment contains no input data from the device after editing. If this occurs and there are no more segments containing input data from the device, the message is terminated, and the last segment in the message is the last segment that contained input data from the device. If a segment is created that has no input data from the device, but there are subsequent segments that do contain data from the device, a segment is created with a single byte of data (X'3F') signifying that this is a pad or null segment. If this occurs on a first segment that is defined to contain a literal, an invalid transaction code could result because MFS does not insert explicit or default literals into segments for which no device input data is received.

MFS option 3

Option 3 formatting supplies the program with only the fields received from the input device. A segment is presented only if it contains fields that were received from the device. Segments are identified by a relative segment number and fields within a segment are identified by a segment offset. Segments and fields are both of variable length if they are described as having a fill character of NULL. Empty fields (fields without data) are not padded with fill characters. Segments that are presented to the application program appear in relative segment number sequence. Fields within the segment are in segment offset sequence.

Option 3 messages do not contain literals (explicit or default) specified in the MID.

If option 3 is used with conversational transactions, the transaction code is not removed from the message, since fields and offsets of fields are maintained within the text. The transaction code is still found in the SPA also.

Restriction: You cannot use option 3 input message formats to enter IMS TM commands. However, IMS TM commands can be entered by using IMS-supplied default formats, from the cleared screen, or from your defined option 1 and option 2 input message formats.