Previous Topic: Helpful HintsNext Topic: Random Access of VSAM Files (CULLUS25)


Source Code Modifications

The CULLUS22 source code, shown below, must be modified when:

z/OS Identifications

When more than one ISAM is to be accessed by CULLUS22:

  1. Define the first ISAM file on the DD statement for US22 in CA Culprit JCL.
  2. Define all other ISAM files by changing the DDNAME parameter in the DCB macro in CULLUS22 source code.
  3. Reassemble and link edit the module, using a unique name such as CULLUSnn where nn is a 2-digit number not used by any CA-supplied module.

z/VSE Modifications

z/VSE users must modify CULLUS22 source code to define one or more ISAM files:

  1. If the ISAM file key is not packed, change the CP instruction to CLC and modify the length of the move to match the length of the ISAM key.
  2. If the length of the ISAM record is greater than 256 bytes, code additional MOVE statements, as appropriate.
  3. If the ISAM key is not packed, change the ZAP instruction to MVC and modify the length of the instruction to match the ISAM key length.
  4. Change the length and data type of LKEY to match the length of the ISAM key.
  5. Change the length of the ISREC field to match the length of the ISAM file.
  6. Modify the following parameters in the DTFIS macro:
  7. Modify the length of IOA1 to match the length of one ISAM block.
  8. Assemble and link edit the module.

CULLUS22 Source Code

Source code modifications are required to define the ISAM files. In z/OS systems, modifications are required only when using multiple ISAM files. z/VSE requires modification to define all ISAM files used in the run.

CULLUS22 START 0
         USING CULLUS22,15
         B     @START                   BRANCH AROUND HEAD MACRO
         CULHEAD NOCODE=YES,PATCH=NO
@START   DS    0H
         STM   14,12,12(13)             SAVE REGISTERS
         LR    12,15                    LOAD BASE REGISTER
         DROP  15
         USING CULLUS22,R12             TELL THE ASSEMBLER ABOUT IT
         ST    13,SAVE+4                DO
         LR    10,13                       STANDARD
         LA    13,SAVE                              SAVE AREA
         ST    13,8(10)                                       LINKAGE
         LM    4,6,4(1)                 PICK UP ARGS 1 TO 3
         CLI   0(5),C'C'                IS USER CALLING FOR CLOSE?
         BE    CLOSEIT                    YES
RESET    NOP   GETIT                    ACTIVE BRANCH ON ALL BUT 1ST
         MVI   *-3,X'F0'                SET BRANCH ON
         OPEN  ISFILE                   OPEN IS FILE
GETIT    CLI   LCODE,0                  IS IT 1ST TIME THRU?
         BE    GETKEY                     YES - SKIP CLC W/LAST KEY
         CLI   LCODE,C'E'               WAS THERE I/O ERROR ON LAST GET
         BE    GETKEY                     YES - GO READ IT AGAIN
***
***                CHANGE THE FOLLOWING INST AS REQUIRED
***                (IF NOT PACKED DEC DO CLC ETC.)
***
         CP    LKEY,0(8,6)              LAST KEY VS. CURRENT REQUEST
         BE    READOK                   SAME KEY -PROCESS AGAIN
***
***                THE FOLLOWING CONVERTS P.DEC TO BINARY
***                REPLACE AS REQUIRED
***
GETKEY   MVC   DBLWD,0(6)               MOVE KEY TO DOUBLE WORD
         CVB   7,DBLWD                  CONVERT TO BINARY (KEY FORMAT)
         ST    7,SKEY                   PUT IN KEY LOCATION
         READ  ISFILE,KEY               READ RECORD CALLED FOR BY KEY
         WAITF ISFILE                   WAIT FOR I/O COMPLETION
         TM    ISFILEC,X'CE'
         BZ    READOK                     NO I/O ERROR
         MVI   0(5),C'E'                SIGNAL I/O ERROR
         B     NORECORD                 GO BLANK I/O AREA
READOK   MVI   0(5),C'N'                SET CODE TO NO RECORD
         TM    ISFILEC,X'10'
         BO    NORECORD                   NO
         MVI   0(5),C'Y'                SET CODE TO RECORD FOUND
***
***                IF RECORD LENGTH EXCEEDS 256 BYTES 2 OR MORE
***                MVC STATEMENTS WOULD BE NEEDED
***
         MVC   0(L'ISREC,4),ISREC       MOVE RECORD INTO USER AREA
         B     RETURN                   GO BACK TO USER
NORECORD MVI   0(4),C' '                START BLANKING USER AREA
***
***                IF RECORD LENGTH EXCEEDS 256 BYTES 2 OR MORE
***                MVC STATEMENTS WOULD BE NEEDED
***
         MVC   1(L'ISREC-1,4),0(4)      PROPAGATE BLANKS
         B     RETURN                   GO BACK TO USER
CLOSEIT  CLI   LCODE,C'C'               WAS LAST CALL TO CLOSE?
         BE    RETURN                   GO BACK TO USER- ALREADY CLOSE
         CLOSE ISFILE                   CLOSE IS FILE AS REQUESTED
         MVI   RESET+1,X'00'            RESET SO IT WILL OPEN ON NXCALL
RETURN   MVC   LCODE,0(5)               SAVE RETURN CODE
***
***                CHANGE TO MVC OR AS REQUIRED
***
         ZAP   LKEY,0(8,6)              SAVE KEY
         L     13,SAVE+4                RESTORE REG 13
         LM    14,12,12(13)             RESTORE REGS 14 TO 12
         SR    15,15                    CLEAR REG 15
         BR    14                       RETURN TO USER
LCODE    DC    X'0'                     SAVE LAST RETURN CODE
DBLWD    DS    D                        DOUBLE WORD WORK AREA
***
***                SET LKEY TO LENGTH (& TYPE) OF INPUT KEY
***                SET SKEY TO LENGTH (& TYPE) OF ON FILE
***                SET ISREC TO LENGTH OF ONE RECORD (INCLUDING KEY)
***
LKEY     DC    PL8'0'                   SAVE LAST KEY HERE
SKEY     DC    F'0'                     CURRENT KEY REQUESTED
ISREC    DS    CL174                    I/O WORK AREA (1 RECORD)
SAVE     DS    18F                      LINKAGE SAVE AREA
***
***                SET DTFIS PARAMETERS AS REQUIRED
***
ISFILE   DTFIS                                                         X
               DEVICE=2314,                                            X
               DSKXTNT=6,                                              X
               HINDEX=2314,                                            X
               IOAREAR=IOA1,                                           X
               IOROUT=RETRVE,                                          X
               KEYARG=SKEY,                                            X
               KEYLEN=4,                                               X
               KEYLOC=1,                                               X
               MSTIND=YES,                                             X
               NRECDS=4,                                               X
               RECFORM=FIXBLK,                                         X
               RECSIZE=174,                                            X
               TYPEFLE=RANDOM,                                         X
               WORKR=ISREC
***
***                SET IOA1 TO SIZE OF ONE BLOCK
***
IOA1     DS    CL696                    I/O AREA FOR DTFIS
         END

Example

This sample code shows the CA Culprit parameters required to retrieve an ISAM record.

The following code: