REXX transaction programs

A REXX transaction program can use any PSB definition. The definition set up by the IVP for testing is named IVPREXX.

A section of the IMS stage 1 definition is shown in the following example:

**********************************************************************
*   IVP APPLICATIONS DEFINITION FOR DB/DC, DCCTL                     *
**********************************************************************
         APPLCTN GPSB=IVPREXX,PGMTYPE=TP,LANG=ASSEM  REXXTDLI SAMPLE
           TRANSACT CODE=IVPREXX,MODE=SNGL,                            X
               MSGTYPE=(SNGLSEG,NONRESPONSE,1)

This example uses a GPSB, but you could use any PSB that you have defined. The GPSB provides a generic PSB that has an TP PCB and a modifiable alternate PCB. It does not have any database PCBs. The language type of ASSEM is specified because no specific language type exists for a REXX application.

Recommendation: For a REXX application, specify either assembler language or COBOL.

IMS schedules transactions using a load module name that is the same as the PSB name being used for MPP regions or the PGM name for other region types. You must use this load module even though your application program consists of the REXX EXEC. The IMS adapter for REXX provides a load module for you to use. This module is called DFSREXX0. You can:

For example, the following code sample shows a section from the PGM setup job that uses the binder to perform the copy function to the name IVPREXX. The example uses the IVP.

//* REXXTDLI SAMPLE - GENERIC APPLICATION DRIVER
//*
//LINK    EXEC PGM=IEWL,
//          PARM='XREF,LIST,LET,SIZE=(192K,64K)'
//SYSPRINT  DD SYSOUT=*   
//SDFSRESL  DD DISP=SHR,DSN=IMS.SDFSRESL  
//SYSLMOD   DD DISP=SHR,DSN=IMS1.PGMLIB  
//SYSUT1    DD UNIT=(SYSALLDA,SEP=(SYSLMOD,SYSLIN)), 
//             DISP=(,DELETE,DELETE),SPACE=(CYL,(1,1)) 
//SYSLIN    DD *  
  INCLUDE   SDFSRESL(DFSREXX0) 
     ENTRY DFSREXX0    
       NAME  IVPREXX(R)   
/*

When IMS schedules an application transaction, the load module is loaded and given control. The load module establishes the REXX EXEC name as the PGM name with an argument of the Transaction Code (if applicable). The module calls a user exit routine (DFSREXXU) if it is available. The user exit routine selects the REXX EXEC (or a different EXEC to run) and can change the EXEC arguments, or do any other desired processing.

Upon return from the user exit routine, the action requested by the routine is performed. This action normally involves calling the REXX EXEC. The EXEC load occurs using the SYSEXEC DD allocation. This allocation must point to one or more partitioned data sets containing the IMS REXX application programs that will be run as well as any functions written in REXX that are used by the programs.

Standard REXX output, such as SAY statements and tracing, is sent to SYSTSPRT. This DD is required and can be set to SYSOUT=A.

When the stack is empty, the REXX PULL statement reads from the SYSTSIN DD. In this way, you can conveniently provide batch input data to a BMP or batch region. SYSTSIN is optional; however, you will receive an error message if you issue a PULL from an empty stack and SYSTSIN is not allocated. The following code example shows the JCL necessary for MPP region that runs the IVPREXX sample EXEC.

JCL code used to run the IVPREXX sample exec

//IVP32M11 EXEC PROC=DFSMPR,TIME=(1440),
//         AGN=IVP,          AGN NAME
//         NBA=6,
//         OBA=5,
//         SOUT='*',         SYSOUT CLASS
//         CL1=001,          TRANSACTION CLASS 1
//         CL2=000,          TRANSACTION CLASS 2
//         CL3=000,          TRANSACTION CLASS 3
//         CL4=000,          TRANSACTION CLASS 4
//         TLIM=10,          MPR TERMINATION LIMIT
//         SOD=,             SPIN-OFF DUMP CLASS
//         IMSID=IVP1,       IMSID OF IMS CONTROL REGION
//         PREINIT=DC,       PROCLIB DFSINTXX MEMBER
//         PWFI=Y            PSEUDO=WFI
//*
//* ADDITIONAL DD STATEMENTS
//*
//DFSCTL   DD DISP=SHR,
//            DSN=IVPSYS32.PROCLIB(DFSSBPRM)
//DFSSTAT  DD SYSOUT=*
//* REXX EXEC SOURCE LOCATION
//SYSEXEC  DD DISP=SHR,
//            DSN=IVPIVP32.INSTALIB
//         DD DISP=SHR,
//            DSN=IVPSYS32.SDFSEXEC
//* REXX INPUT LOCATION WHEN STACK IS EMPTY
//SYSTSIN  DD *
/*
//* REXX OUTPUT LOCATION
//SYSTSPRT DD SYSOUT=*
//* COBOL OUTPUT LOCATION
//SYSOUT   DD SYSOUT=*