MAP OUT (COBOL)

The MAP OUT statement creates or modifies detail occurrences for a pageable map or requests a data transfer from variable-storage data fields to map fields on the terminal screen. MAP OUT can also transfer data to another area in program variable storage; this transfer is referred to as a native mode data transfer.
idmscu
The MAP OUT statement creates or modifies detail occurrences for a pageable map or requests a data transfer from variable-storage data fields to map fields on the terminal screen. MAP OUT can also transfer data to another area in program variable storage; this transfer is referred to as a native mode data transfer.
Syntax
►►─── MAP OUT USING 
map-name
 ─────────────────────────────────────────────────►  ►─┬──────────┬───────────────────────────────────────────────────────────────►    ├─ WAIT ◄ ─┤    └─ NOWAIT ─┘  ►─┬──────────────────────────────────────────────────────────────────────────►─    ├─ IO ◄ ───────────────────────────────────────────────────────────────────    │    └─ NOIO DATASTREAM INTO 
data-location
 ─┬─ TO 
end-data-location
 ───┬────────                                           └─ max LENGTH 
data-length
 ─┘   ─►─────────────────────────────────────────────┬──────────────────────────────►   ─────────────────────────────────────────────┤                                                │   ─┬─────────────────────────────────────────┬─┘    └─ RETURN LENGTH 
into data-actual-length
 ─┘  ►─┬─────────────────────────────────────────────────────────────────────┬────►    └─ OUTPUT ─┬───────────────────────────┬─┬───────────┬─┬────────────┬─┘               └─ DATA is ─┬─ YES ───────┬─┘ ├─ NEWPAGE ─┤ └─ LITERALS ─┘                           ├─ NO ────────┤   └─ ERASE ───┘                           ├─ ERASE ─────┤                           └─ ATTRIBUTE ─┘  ►─┬──────────────────────────────────────────────────────────────┬───────────►    └─ MESSAGE IS 
message-text
 ─┬─ TO 
end-message-data-location 
─┬─┘                                └─ LENGTH 
data-length
 ───────────┘    ►─┬──────────────────────────────────────────┬─ . ───────────────────────────►◄    ├─ DETAIL ─┬───────────┬─┬──────────────┬──┤    │          ├─ NEW ◄ ───┤ └─ KEY 
is key
 ─┘  │    │          └─ CURRENT ─┘                   │    │                                          │    └─ RESUME ─┬─────────────────────────────┬─┘               └─ PAGE is ─┬─ CURRENT ◄ ───┬─┘                           ├─ NEXT ────────┤                           ├─ PRIOR ───────┤                           ├─ FIRST ───────┤                           ├─ LAST ────────┤                           └─ 
page-number
 ─┘
Parameters
  • MAP OUT USING
    map-name
    Specifies the map to use for the MAP OUT request. The map must be included in the MAP SECTION of the program.
  • WAIT
    Specifies a synchronous data transfer. The issuing task is placed in an inactive state. When the MAP OUT operation is complete, the task resumes processing according to its established dispatching priority. This value is the default.
  • NOWAIT
    Specifies an asynchronous data transfer. The task continues executing. If NOWAIT is specified, the program must issue a CHECK TERMINAL before performing any other I/O operation.
  • IO
    Transfers data from variable-storage data fields that are associated with the named map to the terminal device that is associated with the issuing task. This value is the default.
  • NOIO DATASTREAM INTO 
    data-location
    Transfers data from variable-storage data fields that are associated with the named map to another area of program variable storage. No terminal I/O is associated with the request. Specify the symbolic name of a user-defined field containing the WORKING-STORAGE SECTION or LINKAGE SECTION entry to which the data is to be transferred.
  • TO 
    end-data-location
    Indicates the end of the WORKING-STORAGE SECTION or LINKAGE SECTION entry for the output data stream and is specified following the last data-item entry in 
    data-location
    . Specify the symbolic name of a user-defined dummy byte field or a field containing a data item that is not associated with the output data stream.
  • max LENGTH 
    data-length
    Defines the maximum length of the output data stream. Specify the symbolic name of the user-defined field that contains the length of the data stream, or the length itself expressed as a numeric constant.
  • RETURN LENGTH INTO 
    data-actual-length
    Specifies the WORKING-STORAGE SECTION or LINKAGE SECTION entry to which CA IDMS returns the length in bytes of the output data stream. If the data stream has been truncated, this entry contains the length before truncation.
  • OUTPUT
    Specifies screen display options for the data being output. This option applies only to IO requests.
  • DATA IS
    Specifies whether to transmit the variable-storage data fields to the terminal. This specification applies to all variable-storage data fields unless it is overridden by an OUTPUT DATA IS YES/NO clause in a previously issued MODIFY MAP request.
    • YES 
      Transmits the contents of variable-storage data fields to the corresponding map fields.
    • NO 
      Does not transmit the contents of variable-storage data fields to the corresponding map fields. However, if the automatic error handling facility detects an error in any field, the applicable attribute bytes are transmitted.
    • ERASE 
      Does not transmit the contents of variable-storage data fields and fills the corresponding map fields with null values.
    • ATTRIBUTE 
      Transmits only the attribute bytes for variable-storage data fields. Data in the record buffer is not sent to the terminal.
  • NEWPAGE|ERASE
    Activates the erase-write function. The screen is cleared and the literal and variable fields are transmitted to the map. If NEWPAGE or ERASE is not specified, any existing screen display is overwritten without first erasing it. (NEWPAGE and ERASE are synonymous.)
    To erase individual map fields, use the OUTPUT DATA IS ERASE option of the MODIFY MAP statement. To erase all screen fields and to activate the erase-write function, the MAP OUT statement must specify OUTPUT DATA IS ERASE NEWPAGE.
  • LITERALS
    Transmits literal fields and variable-storage data fields to the terminal. If LITERALS is not specified, literal fields are written to the map only when a MAP OUT request specifies the ERASE option.
  • MESSAGE IS 
    message-text
     
    Specifies the message to display in the map message area. Specify the symbolic name of a WORKING-STORAGE SECTION or LINKAGE SECTION entry that contains the message text. This option applies only to IO requests.
    • The MESSAGE parameter can only be used with MAP OUT DETAIL when the $MESSAGE field is associated with the detail occurrence at map generation.
    • To reference a message that is stored in the data dictionary, use the ACCEPT TEXT INTO parameter of the WRITE LOG statement to copy the message into
      message-text
      .
  • TO 
    end-message-data-location
    Specifies the end of the WORKING-STORAGE SECTION or LINKAGE SECTION entry that contains the message text and is specified following the last data item in 
    message-text
    . Specify the symbolic name of a user-defined dummy byte field or a field containing a data item that is not associated with the output data stream.
  • LENGTH 
    data-length
    Defines the length of the message text in bytes. Specify the symbolic name of a user-defined field that contains the length, or the length itself expressed as a numeric constant.
  • DETAIL
    Creates or modifies a detail occurrence, and optionally associates a numeric key value with the occurrence. This option applies only to pageable maps.
  • NEW
    Creates a detail occurrence of a pageable map. This value is the default.
    Occurrences are displayed in the order in which they are created by the application program.
  • CURRENT
    Modifies the detail occurrence that was referenced by the most recent MAP IN DETAIL or MAP OUT DETAIL statement.
  • KEY IS 
    key
    Specifies a value to associate with the created or modified detail occurrence. Specify the name of a PIC S9(8) COMP (fullword) field containing the key of a database record that is associated with the detail occurrence.
    The 4-byte numeric value is not displayed on the terminal screen. When the KEY IS parameter is used with the MAP OUT DETAIL CURRENT command, the specified value replaces the value (if any) that was previously associated with the detail occurrence.
  • RESUME
    Specifies the page of detail occurrences to map out to the terminal. This option applies only to pageable maps.
    • PAGE is CURRENT 
      Redisplays the current page. This value is the default. If no page has been displayed, the first page of the pageable map is displayed.
    • PAGE is NEXT 
      Displays the page that follows the current page. If no page follows the current page, the current page is redisplayed.
    • PAGE is PRIOR 
      Displays the page that precedes the current page. If no page precedes the current page, the current page is redisplayed.
    • PAGE is FIRST 
      Displays the first available page of detail occurrences.
    • PAGE is LAST 
      Displays the page of detail occurrences with the highest available page number.
    • PAGE is 
      page-number
      Specifies the number of the page to display. A page number is stored in the variable field by a preceding MAP IN PAGE IS 
      page-number
       statement that names the same numeric variable field.
Examples
The following examples illustrate the use of the MAP OUT statement:
  • Example 1
    The following statement writes all literal and data fields that are associated with the EMPMAPLR map to the terminal:
    MAP OUT USING EMPMAPLR   OUTPUT DATA IS YES   NEWPAGE   MESSAGE IS INITIAL-MESSAGE LENGTH 80.
  • Example 2
    The following statement maps out the current detail. If the first page of the pageable map is not yet filled, no terminal I/O is associated with this request:
    MAP OUT USING EMPMAPPG   DETAIL   KEY IS DETAIL-KEY.
Status Codes
After completion of the MAP OUT function, the ERROR-STATUS field in the IDMS-DC communications block indicates the outcome:
Status code
Meaning
0000
The request has been serviced successfully.
4625
The output operation has been interrupted. The operator has pressed ATTENTION or BREAK.
4626
A logical error (for example, an invalid control character) has been encountered in the output data stream.
4627
A permanent I/O error has occurred during processing.
4628
The dial-up line for the terminal has been disconnected.
4631
The map request block (MRB) contains an invalid field, indicating a possible error in the program parameters.
4632
The derived length of the specified map output data area is zero or negative.
4633
The map load module that was named in the MRB cannot be found.
4634
The specified LINKAGE SECTION entry is not at COBOL 01-level.
4638
The WORKING-STORAGE SECTION or LINKAGE SECTION entry that was specified for return of the output data stream has not been allocated.
4639
The terminal being used is out of service.
4640
The NOIO option has been specified but the requested data stream cannot be found.
4642
The requested map does not support the terminal device being used.
4652
The specified edit or code table cannot be found or is invalid for use with the named map.
4653
An error has occurred in a user-written edit routine.
4654
A data conversion error has occurred. The internal map data does not match the data description of the map.
4655
The user-written edit routine that was specified for the named map cannot be found.
4664
There is no current detail occurrence to be updated (MAP OUT DETAIL CURRENT only). No action is taken.
4668
The amount of storage that was defined for pageable maps at system generation time is insufficient. No action is taken. This statement and subsequent MAP OUT DETAIL statements are ignored.
4672
No detail occurrence, footer, or header fields exist to be mapped out by a MAPOUT RESUME command.
4676
The first screen page has been transmitted to the terminal.
4680
A pageable map page has been built but the page has not been displayed. This outcome can happen after you specify STARTPAGE NOAUTODISPLAY. Test for it after each MAP OUT DETAIL statement.