Previous Topic: ExamplesNext Topic: Examples


MFLD Statement Syntax

Functions Performed

An MFLD statement for MAP AUTOPANEL is used to add a map field to a map by performing the following functions:

►►──┬──────────┬─ MFld ───────────────────────────────────────────────────────►
    ├─ ADD ────┤
    └─ MODify ─┘

 ►──┬───────────────────────────────────────┬─────────────────────────────────►
    └─ OCCURS ─┬─ 1 ◄ ────────────────────┬─┘
               └─ occurrence-count times ─┘

 ►──┬─────────────────────────────────────────────────────────────────────────►
    ├─ FOR ALL ◄ ────────────────────┬────────────────────────────────────────
    │         ┌────── , ──────┐      │
    └─ FOR ( ─▼─ device-code ─┴─ ) ──┘

 ►────────────────────────────────────────────────────────────────────────────►
  ─┬───────────────────────────────────────┬──────────────────────────────────
   └─ AT ─┬─ ANYwhere ───────────────────┬─┘
          │ ┌──────────────────────────┐ │
          └─▼─ ( row ─┬─ 1 ◄ ────┬─ ) ─┴─┘
                      └─ column ─┘
 ►────────────────────────────────────────────────────────────────────────────►
  ─┬──────────────────────────────────────────┬───────────────────────────────
   └─ ATTRibutes = ─┬─ NONE ────────────────┬─┘
                    └─ ( attributes-list ) ─┘

 ►────────────────────────────────────────────────────────────────────────────►
  ─┬───────────────────────────────────┬──────────────────────────────────────
   ├─ DELIMit ─┬──────┬──┬─ SKIP ◄ ─┬──┤
   │           ├─ IS ─┤  └─ NOSKIP ─┘  │
   │           └─ = ──┘                │
   └─ NODELIMit ───────────────────────┘

 ►────────────────────────────────────────────────────────────────────────────►
  ─┬───────────────────────────────────────────┬──────────────────────────────
   └─ PAGing type ─┬──────┬─┬─ DETail STart ─┬─┘
                   ├─ IS ─┤ ├─ DETail ONLY ──┤
                   └─ = ──┘ ├─ DETail ENd ───┤
                            ├─ FOOTer STart ─┤
                            └─ NULl ◄────────┘
 ►──────────────────────────────────────────────────────────────────────────┬─►
  ─┬──────────────────────────────────────────────────────────────────────┬─┘
   └─ VALue ─┬────┬─┬─ 'data-value' ────────────────────────────────────┬─┘
             ├ IS ┤ │    ┌─────────────────────────────────────────┐    │
             └ = ─┘ └─( ─▼─┬──────────────────────┬─ 'data-value' ─┴─ )─┘
                           └─ (occurrence count) ─┘

 ►─┬─ CURSOR ─────┬───────────────────────────────────────────────────────────►
   └─ NOCURSOR ◄ ─┘

 ►─┬─ LITeral ◄ ─────────────────────┬────────────────────────────────────────►◄
   ├─ MESSage LENgth ─┬─ length ─┬───┤
   │                  └─ 80 ◄ ───┘   │
   ├─ PAGE LENgth 4 ─────────────────┤
   ├─ RESPonse LENgth ─┬─ length ─┬──┤
   │                   └─ 80 ◄ ───┘  │
   └─ DFld dfld-specifications ──────┘

Expansion of dfld-specifications

►►─── data-field-name ─┬────────────────────────┬─────────────────────────────►
                       └─ ( subscript-number ) ─┘

 ►─┬──────────────────────────────────────────────────────┬───────────────────►
   └─ OF ─┬─ record-name ─┬──────────────────────────┬──┬─┘
          │               └─ VERsion version-number ─┘  │
          └─ role-name ─────────────────────────────────┘

 ►──┬─────────────────────────────────────────────────────────────────────────►
    └─ HELP ──────────────────────────────────────────────────────────────────

 ►────────────────────────────────────────────────────────────────────────────►
  ──── SOUrce ─┬─ NONE ───────────────────────────────────────────────────────
               └─ MODule module-name ─┬─────────────────────────────────────┬─
                                      └─ VERsion ─┬──────┬─ version-number ─┘
                                                  ├─ IS ─┤
                                                  └─ =  ─┘

 ►──────────────────────────────────────────────────────────────────────────┬─►
  ────────────────────────────────────────────────────────────────────┬─────┘
  ──┬────────────────┬────────────────────────────────────────────────┘
    ├─ HALF screen ◄─┤
    └─ FULL screen ──┘
 ►─┬─ REQuired ───┬───────────────────────────────────────────────────────────►
   └─ OPTional ◄ ─┘

 ►─┬───────────────────────────────────────┬──────────────────────────────────►
   └─ REVerse NUMeric ─┬──────┬──┬─ Yes ─┬─┘
                       ├─ IS ─┤  └─ No ──┘
                       └─ = ──┘

 ►─┬──────────────────────────────────────────────────────────┬───────────────►
   └─ UNDERSCORE when blank ──┬─ No ◄─┬───────────────────────┘
                              └─ Yes ─┘

 ►─┬─ NOEDIT ◄ ───────────────────────────────────────────────────────────────►
   └─ EXTernal PICture ─┬───────┬─┬─ 'picture'──┬─────────────────────────────
                        ├─ IS ──┤ └─ INTernal ──┘
                        └─ = ───┘
 ►────────────────────────────────────────────────────────────┬───────────────►
  ─┬──────────────────────────┬─┬───────────────────────────┬─┘
   ├─ ZEROed ◄ ─┬─ when null ─┘ ├─ DISPlay ◄ ─┬─ when zero ─┘
   └─ RETAINed ─┘               └─ BLANK ─────┘

 ►─── EDIT TABle ─┬──────┬─┬─ NULL ◄ ─────────────────────────────────────────►
                  ├─ IS ─┤ └─ table-name ─┬──────────────────────────┬────────
                  └─ = ──┘                └─ VERsion version-number ─┘

 ►──────────────────────────────────────────────┬─────────────────────────────►
  ─┬─ LINK ◄ ─┬─┬─────────────────────────────┬─┘
   └─ NOLINK ─┘ └─ USAGE is ─┬─ VALIDate ───┬─┘
                             ├─ INVALIDate ─┤
                             └─ DEFault ◄ ──┘

 ►─┬────────────────────────────────────────────────────────────────────────┬─►
   └ CODE TABle ─┬────┬─┬ NULL ◄ ──────────────────────────────────────────┬┘
                 ├ IS ┤ └ table-name ─┬────────────────────────┬─┬ LINK ◄ ┬┘
                 └ = ─┘               └ VERSION version-number ┘ └ NOLINK ┘

 ►─┬───────────────────────────────────┬──────────────────────────────────────►
   └─ ERROR MESSage ──┬─ 'message'───┬─┘
                      ├─ message-id ─┤
                      └─ NULL ◄ ─────┘
 ►──┬─────────────────────────────────────────────┬───────────────────────────►
    └─ MSG PREFIX ─┬──────┬───┬──── DC ◄ ─────────┤
                   ├─ IS ─┤   └─ message-prefix ──┘
                   └─ =  ─┘

 ►─┬──────────────────────────────────────────────────────────────────────────►
   └─ FOR INput ─┬───────────────────────┬─┬──────────────────────────┬───────
                 └─ JUSTify ─┬─ Left ──┬─┘ └─ PAD ─┬─ No ◄ ─────────┬─┘
                             └─ Right ─┘           └─ with literal ─┘
 ►────────────────────────────────────────────────────────────────────────────►
  ─┬────────────────────┬─────────────────────────────────────────────────────
   └─ DATA ─┬─ YES ◄ ─┬─┘
            └─ NO ────┘
 ►────────────────────────────────────────────────────────────────────────────►
  ─┬───────────────────────────────────────────────────────────┬──────────────
   └─ UPPERCASE ──┬─ NO ◄─┬────────────────────────────────────┘
                  └─ YES ─┘

 ►────────────────────────────────────────────────────────────────────────┬───►
   ─┬─────────────────────────────────────┬── WITH AUTOedit ─┬─ NO ◄ ───┬─┘
    └─ EDIT ─┬───────┬─ edit-module-name ─┘                  ├─ BEFore ─┤
             ├─ IS ──┤                                       └─ AFTer ──┘
             └─ = ───┘

 ►─┬──────────────────────────────────────────────────────────────────────────►
   └─ FOR OUTPUT ─┬───────────────────────┬─┬────────────────────────┬────────
                  └─ BACKscan ─┬─ YES ──┬─┘ └─ DATA ─┬─ YES ◄ ─────┬─┘
                               └─ NO ◄ ─┘            ├─ NO ────────┤
                                                     ├─ ERASE ─────┤
                                                     └─ ATTRibute ─┘

 ►────────────────────────────────────────────────────────────────────┬─ . ───►◄
  ─┬──────────────────────────────────┬── WITH AUTOedit ─┬─ NO ◄ ───┬─┘
   └─ EDIT ─┬────┬─ edit-module-name ─┘                  ├─ BEFore──┤
            ├ IS ┤                                       └─ AFTer ──┘
            └ = ─┘
Parameters
ADD/MODIFY

Specifies the action taken with regard to the MFLD statement. The DELETE verb cannot be specified for MFLD statements for MAP AUTOPANEL.

Note: For information about how to remove a field occurrencefrom a map occurrence that was defined by a MAP AUTOPANEL statement, see "Compiler Action Verbs."

MFLD

Introduces the clauses that define a map field and associated panel field occurrence.

OCCURS 1/occurrence-count TIMES

Specifies the number of times the field is to appear on the map; the default is 1.

FOR ALL /(device-code-a)

Associates the specified screen sizes with field specifications established by subsequent AT, ATTRIBUTES, DELIMIT, and VALUE clauses. If the map is used with more than one screen size, multiple FOR specifications can be included in the MFLD statement to establish different information for each screen size.

For a more detailed description of this latter use of the FOR specification, see "Defining Versions of Maps for Different Devices."

A field is associated with specific devices as follows:

ALL

Specifies that subsequent clauses of the MFLD statement apply to all screen sizes specified in the related DEVICES clause.

(Device-code-a)

Specifies one or more devices. Subsequent clauses of the MFLD statement apply only to the designated screen sizes. More than one device-code-a specification can be included in a FOR clause. The number of valid device-code-a specifications depends on the number of screen types declared in the related DEVICES specification.

Valid screen sizes are 12X40, 12X80, 24X80, 32X80, 43X80, and 27X132. Device specifications must be enclosed in parentheses and separated by commas; for example, FOR (12X40,12X80).

AT ANYWHERE/ (row,1/column)

Specifies the screen coordinate of the attribute byte for a field by row and column. The coordinate establishes the location of a runtime field on a given screen. An attribute byte is a nondisplayable character that precedes the displayed field and defines the field's attributes.

The field itself is displayed starting at the coordinate that immediately follows the nondisplayable attribute byte. For example, a field displays starting in coordinate (5,11) for an AT (5,10) specification.

The following considerations apply to the placement of attribute bytes and fields:

Screen coordinates are designated as follows:

ANYWHERE

Specifies that the field can appear anywhere on the screen. ANYWHERE is meaningful only with mapin operations for which the requesting program reads extraneous data. Extraneous data is data that is not associated with a field at a specific row/column location.

(Row-n,column-n)

Specifies the row and column coordinates for the attribute byte for the field:

  • Row-n identifies a horizontal position on the screen.
  • Column-n identifies a vertical position on the screen; the default column is 1.

The following considerations apply when positioning multiply-occurring fields:

ATTRIBUTES=NONE/(attributes-list)

Specifies the attributes for the field. Only one ATTRIBUTES clause can occur in a given MFLD statement. ATTRIBUTES specifications apply to all occurrences of the field. Valid specifications are as follows:

DELIMIT/NODELIMIT

Specifies whether a delimit character is placed after the final position of a data field:

PAGING TYPE IS DETAIL ONLY/START/DETAIL END/FOOTER START/NULL

(pageable maps only). Specifies whether the field begins and/or ends the detail occurrence or an area on the pageable map:

Note: For more information about the areas of pageable maps, see "Pageable Maps."

VALUE IS data-value/((occurrence-count) data-value)

Supplies string values to literal fields:

A maximum of 256 characters can be specified for a literal field in data-value

CURSOR/NOCURSOR

Specifies the mapout location of the cursor at runtime:

If CURSOR is specified in more than one MFLD statement for a given map, the runtime cursor is positioned at the field for which CURSOR was last specified at compile time. If CURSOR is not specified for any field on the map, the default runtime cursor location is the first UNPROTECTED field on the screen, or at coordinate 1,1 if there are no UNPROTECTED fields.

LITERAL

Specifies that the field is a literal field. A literal field is given a string value in the VALUE IS clause. If LITERAL, MESSAGE LENGTH, PAGE LENGTH, RESPONSE LENGTH, or DFLD is not specified in the MFLD statement, LITERAL is the default.

MESSAGE LENGTH length

Specifies that the field is a message field. If included, length must be an integer greater than or equal to 1 and less than or equal to the total number of character positions on the smallest screen for which the map is intended. The default for length-n is 80.

PAGE LENGTH 4

Specifies that the field is a page field.

RESPONSE LENGTH length

CA ADS only. Specifies that the field is a response field. If included, length must be an integer in the range 1 through 32. The default is 8.

DFLD data-field-name (subscript) OF record-name/role-name

Specifies that the field is a data field and associates the field with the record element named by data-field-name:

The length of a data field is not specified in the DFLD clause; the length is determined in one of the following ways:

Remaining MFLD clauses supply automatic editing and error-handling information for the field being defined. For more information about the features enabled by the clauses listed, see the chapter "Automatic Editing and Error Handling." The following MFLD clauses apply only when DFLD is specified for the field:

Note: For more information about the features enabled by the clauses listed, see the chapter "Automatic Editing and Error Handling."

HELP

Specifies whether help will be implemented for the field.

SOUrce NONE/MODule module-name

The name of the IDD module that contains the help text for the field.

If module name is specified, you can optionally specify:

REQUIRED/OPTIONAL

Indicates whether operator input is required in the field:

REVERSE NUMERIC IS YES/NO

Specifies whether the contents of a numeric field are reversed on mapin and again on mapout:

UNDERSCORE when blank NO/YES

Indicates if the field should be underscored if it is blank. On mapin, trailing underscores are removed.

EXTERNAL PICTURE IS/NOEDIT

Indicates whether the field is processed by automatic editing and error-handling, and establishes an external picture for use in editing. The following options are available:

Note: For information about external pictures, see External Pictures.

Picture specifies an actual external picture, such as XX/XX/XX or XXX-XX-XXXX.

Note: For a group data field, the only valid external picture is an alphanumeric one. Note also that edit and code tables are not supported for group data fields.

EDIT TABLE IS table-name/NULL

Specifies the edit table used for the field if automatic editing is enabled for the field and map:

CODE TABLE IS table-name/NULL

Specifies the code table used for the field if automatic editing is enabled for the field and map:

ERROR MESSAGE message/message-id/NULL

Defines the error message returned on mapout if the field is in error. The message is displayed in the message field defined for the map. If the map has no message field, the message is not displayed and processing continues normally (with CA ADS, the message is displayed on the CA ADS default message screen). The developer can specify any one of the following options:

MSG PREFIX IS message-prefix

Defines the two-character prefix to be used to locate the message in the dictionary of the message defined in the previous ERROR MESSAGE parameter when the field is found to be in error at runtime. The value defaults to the value specified in the MSG PREFIX parameter in the MAP statement.

FOR INPUT

Specifies functions performed for data on a mapin operation:

JUSTIFY LEFT/RIGHT

Specifies how operator input is to be aligned for transmission to program variable storage:

PAD NO/WITH literal

Specifies a pad character for an alphanumeric field in character or hexadecimal format:

Pad characters are used to avoid unwanted data being stored for a field on mapin. For example, a data field containing the name JOHNSON is mapped out. The operator presses the ERASE EOF key to erase the field, types in SMITH, and presses Enter. The value mapped to variable storage depends on whether a pad character is defined for the field:

DATA YES/NO

Indicates whether the transmitted contents (if any) of the field are to be moved automatically into program variable storage on a mapin operation:

UPPERcase YES/NO

Indicates if field should be displayed in uppercase.

EDIT IS edit-module-name WITH AUTOEDIT

Optionally specifies the name of an existing user-written edit module to process input after transmission on a mapin operation. The relationship between the user edit module and automatic editing is determined by the WITH AUTOEDIT clause as follows:

User edit modules are discussed in "Automatic Editing and Error Handling".

FOR OUTPUT

Specifies functions to be performed for data prior to a mapout operation:

BACKSCAN YES/NO

Indicates whether trailing blanks are to be eliminated from the field prior to display:

DATA YES/NO/ERASE/ATTRIBUTE

Indicates whether data in program variable storage is to be transmitted to the screen on a mapout operation:

EDIT IS edit-module-name WITH AUTOEDIT

Optionally specifies the name of an existing user-written edit module to process data before display on a mapout operation. The relationship between the user edit module and automatic editing is determined by the WITH AUTOEDIT clause as described as follows:

User-written edit modules are discussed in the chapter "Automatic Editing and Error Handling."