IDMSCALC

The IDMSCALC utility is a subroutine which can be called from a user-written program to determine the target page of a record, based on a user-supplied CALC key. It is typically used to optimize the loading of data by allowing you to sort input in target page sequence. 
idmscu19
The IDMSCALC utility is a subroutine which can be called from a user-written program to determine the target page of a record, based on a user-supplied CALC key. It is typically used to optimize the loading of data by allowing you to sort input in target page sequence. 
IDMSCALC is implemented as a called subroutine. The utility returns to a user-written program a target page number for storage of a CALC record, based on a page range and CALC key value supplied by the program. The user program, which can be written in any language supporting a call statement, must build a single five-field fullword-aligned argument as outlined in the following table, then call IDMSCALC, passing the argument. IDMSCALC must be link edited with the calling program.
The following topics are discussed on this page:
Calling the IDMSCALC Routine
The following example shows how to call the IDMSCALC routine from a user-written program.
         01  CALC-PARMS.            05  CALC-PAGE-TARGET     PIC S9(9) COMP.            05  CALC-PAGE-RANGE-HIGH PIC S9(9) COMP.            05  CALC-PAGE-RANGE-LOW  PIC S9(9) COMP.            05  CALC-KEY-LENGTH      PIC S9(4) COMP.            05  CALC-KEY             PIC X(16).              .            .            .            .              MOVE 75001   TO CALC-PAGE-RANGE-LOW.            MOVE 75101   TO CALC-PAGE-RANGE-HIGH.            MOVE 16      TO CALC-KEY-LENGTH.            MOVE 'SMITH' TO CALC-KEY.            CALL 'IDMSCALC' USING CALC-PARMS.            DISPLAY 'TARGET PAGE IS ' CALC-PAGE-TARGET.
The IDMSCALC Argument
The following table outlines the five-field argument that a calling program must pass to IDMSCALC.
Field
Usage
Size (bytes)
COBOL Picture
Field Description
1 (Output)
Binary
4
PIC S9(9) COMP
Specifies the target page number for storage of the record.
2 (Input)
Binary
4
PIC S9(9) COMP
Specifies the number of the highest page on which the record can be stored.
3 (Input)
Binary
4
PIC S9(9) COMP
Specifies the number of the lowest page on which the record can be stored.
4 (Input)
Binary
2
PIC S9(4) COMP
Specifies the length, in bytes, of the CALC key value.
5 (Input)
Character
1-256
PIC X(nnn)
Specifies the value of the CALC key.
Note:
The information in fields 2 and 3 of IDMSCALC must match the database definition for the record type as specified in the schema.
  • Input
    Input to the IDMSCALC utility consists of the IDMSCALC argument with fields 2-5 initialized by the calling program.
  • Output
    The IDMSCALC utility returns a target page number for storage of a CALC record.