Example: Creating JCL for Managed File Transfer agents on z/OS

Use this information to generate some JCL that can be used to create and start an agent on IBM MQ for z/OS .


Copy the sample library

Carry out the following procedure:
  1. Make a copy of the library SCSQFCMD (see Copy SCSQFCMD to create a JCL library) by opening the library.

    The majority of the members, those that start with BFGX, BFGY, or BFGZ, are templates that we use to generate the customized JCL for the agent later on.

    The important member is BFGCOPY.

  2. Open BFGCOPY and replace:

      ++supplied_library++
      with the name of the SCSQFCMD library that was installed as part of the product.

      ++service-library++
      with the name of the library that we want to use for the agent (the target library).

  3. Submit the job and you have a new library that we can use.


Edit BFGCUSTM

Carry out the following procedure:
  1. Open the new library so that we can edit the BFGCUSTM member (see Editing member BFGCUSTM)
  2. Modify all of the parameters in the member that are enclosed within ++ characters, and replace them with the appropriate values. For example, change:

      ++mq_path++
      The path to the IBM MQ for z/OS UNIX System Services Components directory. For example, /mqm/V9R2M0.Note: There are three instances of this variable to replace.

      ++bfg_data++
      To be the USS directory where the IBM MQ Managed File Transfer for z/OS configuration is to be stored.

      ++service_type++
      To the word AGENT

      ++agent_name++
      To be the name of our agent

Notes:

  1. Some of the entries, such as ++options++ required for the CLEAN_AGENT_PROPS, are not needed and so we should remove these.
  2. See Before you start for a complete list of all of the parameters in the BFGCUSTM member, along with a description of what values they should have.


Submit the BFGCUSTM JCL

Carry out the following procedure:
  1. Submit the job.
  2. Exit the library in ISPF.

    This is necessary because the BFGCUSTM job is updating the library, and cannot do that while the library is open.

  3. When the job completes look at the joblog.

    You will see a number of messages, indicating that new members have been created within the library.

    Each of these members contains JCL that can be used to perform specific tasks for the agent. See z/OS agent and logger command JCL scripts for a list of these members, along with the IBM MQ Managed File Transfer commands that they correspond to.


Submit BFGAGCR to create the agent

The new member BFGAGCR contains some JCL that creates an agent by invoking the fteCreateAgent command.

Carry out the following procedure:
  1. Open up member BFGAGCR.We should see that BFGAGCR has been populated with the name of your:

  2. Submit member BFGAGCR.When the member runs, it:

    • Creates the required configuration files for the agent.
    • Connects to the agent queue manager, and creates the system queues that the agent needs, using CSQUTIL.
    • Registers the agent with the coordination queue manager.


Start the agent by submitting BFGAGST

Carry out the following procedure:
  1. Submit the BFGAGST member. See using the agent for various commands that show you that the agent is working correctly.
  2. When the job completes, check the joblog contains the following messages:
    BFGAG0058I: The agent has successfully initialized. 
    BFGAG0059I: The agent has been successfully started.
    which means that your agent is up, running, and ready to perform managed transfers.

Parent topic: Configure Managed File Transfer for z/OS