IBM Support What's New?

Forum/discussion group


The following example provides JCL to allow MAINVIEW to execute a REXX EXEC.


Here are some common scenarios when using this example can be helpful:

  • You are using a batch job to do an IEBCOPY of a program that you know is pre-loaded in an MPR. If the IEBCOPY is successful, you now want to stop and start the MPR that pre-loaded the program to again pre-load the new version. Use this as a second step to your IEBCOPY job to issue the /STOP REGION JOBNAME MPR1 command and the /START REGION MPR1 within the EXEC "EXECNAME".
  • You have a test database that needs to be reloaded. You can add a step to the beginning of your reload job to issue the /DBR DATABASE DB1 GLOBAL... command. Then add a step at the end of your reload job to issue the /START DATABASE DB1 command.

The "EXECNAME" can be written in REXX. Also, the MAINVIEW IMS task "SS(MVI1)" must be running.

Note: Be cautious of the IMFSUBEX batch job step return code. 2048 indicates the EXEC was scheduled and the EXEC returned a zero return code. A job step return code less than 2048 indicates MAINVIEW did not successfully schedule the EXEC. A job step return code greater than 2048 indicates the EXEC set a return code, the return code value was added to 2048 then the result was used as the job step return code.

//      PARM=('SS(MVI1)',
//      'EXEC(EXECNAME)',
//      'TARGET(IMS1)',

Example submitted by:
David Pearson

Rate this example

This example is from the IMS Examples Exchange. The examples on this Web site are provided on an "as-is" basis. You may copy and modify these examples in any form without payment to IBM, for the purposes of designing and developing application programs conforming to the application programming interface for the z/OS or OS/390 operating system for which these examples are written. Some of these examples have been tested, but many have not. Of those that have been tested, most have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these examples in your particular environment. Use these examples as models for your own situations.  

Document information

More support for: IMS

Software version: 6.1, 7.1, 8.1

Operating system(s): Platform Independent, z/OS

Reference #: 7005657

Modified date: 2004-12-08