How to order a mainframe job from a distributed system of a distributed job from the mainframe.

Version 1
    Share This:

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    PRODUCT:

    Control-M for z/OS


    APPLIES TO:

    Control-M for z/OS



    QUESTION:

    Need to order a task from z/OS DataCenter to UNIX DataCenter

    How can job be ordered cross platform?

    LP: Control-M for z/OS 7.0.02
    DR: Control-M for z/OS 7.0.02
     EM with 2 DataCenters, one in z/OS and the other in UNIX. 
     


    ANSWER:

     

    Legacy ID:KA398584

      


    To order a distributed job from a mainframe system:

    1. If the event that triggered the job has the creation of a dataset
    involved, then you could use AFT to react to the dataset creation and order
    a distributed job.

    2. You could have the job set to run on the distributed side and have a
    global condition added by the mainframe.

    3. Using the BPXBATCH interface, is submit jobs on the Windows platform using a remote shell (rsh) or similar tool. The job would submit to JES, execute remotely on the Windows platform, and the output (stderr/stdout) would be processed on the mainframe.
    As a suggestion you could run a job that will run TSO in batch to execute a remote command on the EM or CONTROL-M/Server machine to perform the FORCE JOB.
    It should look like:
    rexec -l ctm -p ctmpass ctm-server ctmorder -table xxx -job xxx
    (It is either rexec under MVS, or orexec under OMVS).
    Running the remote command on a Windows machine might need an installation of external product like SSH or any other that would accept the remote request.
    The 'rexec' command is available in USS (BPXBATCH) or via TSO (IKJEFT01).
    Issuing a 'ctmorder' command with the appropriate syntax on either the Control-M/Agent or Server remotely allows for the ordering of a job on the distributed side.

    Taken from the CTM User Guide:
    z/OS-Oriented Implementation
    Control-M for z/OS fully supports the USS environment without any need for modifications.
    Control-M for z/OS manages all USS batch processes and integrates them with batch activities on
    _ the local z/OS system
    _ all other platforms across the network
    For Control-M to submit and control all USS executions, all that is required is the definition of a single JCL member. This member contains a USS shell activation program that is supported by the z/OS operating system. AutoEdit variables
    are used to define all elements of the USS task, such as the name of the script, the script
    parameters, the job name and the script location. When Control-M submits the JCL, all the AutoEdit values are resolved and the JCL is submitted with its corresponding values. The JCL then submits the appropriate script under USS. Control-M
    reads the return code of the script execution from the JCL sysout, and proceeds accordingly.
    A sample JCL member is shown in Figure 379.
    Figure 379 JCL for USS Execution
    //jobname JOB (account_info),REGION=5000K
    //STEPNAME EXEC PGM=BPXBATCH
    // PARM='sh /u/usr_id/%%MYSCRPT'
    //STDOUT DD PATH='/u/usr_id/stdout.f',PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
    // PATHMODE=SIRWXU
    //STDERR DD PATH='/u/usr_id/stderr.f',PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
    // PATHMODE=SIRWXU
    In the Control-M job definition that submits the JCL, use the SET VAR
    parameter to
    assign a value to the %%MYSCRPT AutoEdit variable, as follows:
    SET VAR %%MYSCRIPT=uss_script_name




    To order a mainframe job from a distributed system:

    1. You can use a distributed job to use the cli utility to have ctm/em order a job to the mainframe.
    Here is a example I used:
    cli -U emuser -P password -H zz800test -JOB_ORDER CMZ2_K80 TALBERT DUMMY 0412 N BMCCTM.K800O.SCHEDULE

    2. You could have the job set to run on the mainframe side and have a
    global condition added by the distributed system.


    3. You can FTP a job to JES to be submitted:
    Example:
    //FTP1 EXEC PGM=FTP
    //SYSPRINT DD SYSOUT=*
    //INPUT DD *
    SYSID
    RDCRET
    PASSWORD
    QUOTE SITE FILETYPE=JES
    PUT 'RDCRET.JCLLIB(BR14)'
    QUIT
    /*
    //OUTPUT DD SYSOUT=*
    //SYSPRINT DD SYSOUT=*
    The first option works best for me. You can test ordering a test job on the mainframe using a command prompt. until you get the syntax correct. Then use a job to run the command.
     

      
    Related Products:  
       
    1. Control-M for z/OS

     


    Article Number:

    000030499


    Article Type:

    FAQ/Procedural



      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles