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 USINGmap-name─────────────────────────────────────────────────► ►─┬──────────┬───────────────────────────────────────────────────────────────► ├─ WAIT ◄ ─┤ └─ NOWAIT ─┘ ►─┬──────────────────────────────────────────────────────────────────────────►─ ├─ IO ◄ ─────────────────────────────────────────────────────────────────── │ └─ NOIO DATASTREAM INTOdata-location─┬─ TOend-data-location───┬──────── └─ max LENGTHdata-length─┘ ─►─────────────────────────────────────────────┬──────────────────────────────► ─────────────────────────────────────────────┤ │ ─┬─────────────────────────────────────────┬─┘ └─ RETURN LENGTHinto data-actual-length─┘ ►─┬─────────────────────────────────────────────────────────────────────┬────► └─ OUTPUT ─┬───────────────────────────┬─┬───────────┬─┬────────────┬─┘ └─ DATA is ─┬─ YES ───────┬─┘ ├─ NEWPAGE ─┤ └─ LITERALS ─┘ ├─ NO ────────┤ └─ ERASE ───┘ ├─ ERASE ─────┤ └─ ATTRIBUTE ─┘ ►─┬──────────────────────────────────────────────────────────────┬───────────► └─ MESSAGE ISmessage-text─┬─ TOend-message-data-location─┬─┘ └─ LENGTHdata-length───────────┘ ►─┬──────────────────────────────────────────┬─ . ───────────────────────────►◄ ├─ DETAIL ─┬───────────┬─┬──────────────┬──┤ │ ├─ NEW ◄ ───┤ └─ KEYis key─┘ │ │ └─ CURRENT ─┘ │ │ │ └─ RESUME ─┬─────────────────────────────┬─┘ └─ PAGE is ─┬─ CURRENT ◄ ───┬─┘ ├─ NEXT ────────┤ ├─ PRIOR ───────┤ ├─ FIRST ───────┤ ├─ LAST ────────┤ └─page-number─┘
Parameters
- MAP OUT USINGmap-nameSpecifies the map to use for the MAP OUT request. The map must be included in the MAP SECTION of the program.
- WAITSpecifies 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.
- NOWAITSpecifies 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.
- IOTransfers 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 INTOdata-locationTransfers 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.
- TOend-data-locationIndicates 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 indata-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 LENGTHdata-lengthDefines 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 INTOdata-actual-lengthSpecifies 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.
- OUTPUTSpecifies screen display options for the data being output. This option applies only to IO requests.
- DATA ISSpecifies 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.
- YESTransmits the contents of variable-storage data fields to the corresponding map fields.
- NODoes 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.
- ERASEDoes not transmit the contents of variable-storage data fields and fills the corresponding map fields with null values.
- ATTRIBUTETransmits only the attribute bytes for variable-storage data fields. Data in the record buffer is not sent to the terminal.
- NEWPAGE|ERASEActivates 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.
- LITERALSTransmits 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 ISmessage-textSpecifies 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 intomessage-text.
- TOend-message-data-locationSpecifies the end of the WORKING-STORAGE SECTION or LINKAGE SECTION entry that contains the message text and is specified following the last data item inmessage-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.
- LENGTHdata-lengthDefines 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.
- DETAILCreates or modifies a detail occurrence, and optionally associates a numeric key value with the occurrence. This option applies only to pageable maps.
- NEWCreates 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.
- CURRENTModifies the detail occurrence that was referenced by the most recent MAP IN DETAIL or MAP OUT DETAIL statement.
- KEY ISkeySpecifies 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.
- RESUMESpecifies the page of detail occurrences to map out to the terminal. This option applies only to pageable maps.
- PAGE is CURRENTRedisplays 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 NEXTDisplays the page that follows the current page. If no page follows the current page, the current page is redisplayed.
- PAGE is PRIORDisplays the page that precedes the current page. If no page precedes the current page, the current page is redisplayed.
- PAGE is FIRSTDisplays the first available page of detail occurrences.
- PAGE is LASTDisplays the page of detail occurrences with the highest available page number.
- PAGE ispage-numberSpecifies the number of the page to display. A page number is stored in the variable field by a preceding MAP IN PAGE ISpage-numberstatement that names the same numeric variable field.
Examples
The following examples illustrate the use of the MAP OUT statement:
- Example 1The 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 2The 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. |