IBM MQ Managed File Transfer (MFT) for z/OS provides a library called SBFGCMDS. This library contains sample JCL that can be customized to perform various tasks, such as creating agents, and submitting managed transfers. I’ve been playing around with this recently for some PMRs that I’ve been working on, and thought I would write up what I did to create the JCL for my agents.

Step 1: Copy the sample library

The first thing I had to do was to make a copy of the sample library SBFGCMDS, so that I would have a version that I could use for my agent.

In order to do this, I opened up the library to see what it contained.

The members of the SBFGCMDS dataset
The SBFGCMDS library provided by IBM MQ Managed File Transfer for z/OS contained 43 members
There were 43 different members. The majority of them (those that started with BFGX, BFGY or BFGZ) were templates that would be used to generate the customized JCL for my agent later on. The important one for this step was called BFGCOPY. This member contained some JCL that could be used to copy the library.
The BFGCOPY member is used to create a copy of the SBFGCMDS library.
To use the member, I replaced:

  • ++supplied_library++ with the name of the SBFGCMDS library that was installed as part of the product.
  • ++service-library++ with the name of the library that I wanted to use for my agent (the target library).
The ++supplied_library++ and ++service-library++ parameters had to be updated before BFGCOPY could be submitted.
After doing this, the job was submitted and I had my new library to play around with!

Step 2: Edit BFGCUSTM

When I had my copy of the library, I opened it up and edited the BFGCUSTM member. This member contained some JCL which could be used to create additional JCL specific to my agent.

In order to use BFGCUSTM, I had to modify all of the parameters in the member that were enclosed within ++ characters, and replace them with the appropriate values.

BFGCUSTM contains parameters that have the format ++<parameter name>++
BFGCUSTM contains a number of parameters that have the format ++<parameter name>++

For example, I changed:

  • ++bfg_prod++ to point to the USS directory where IBM MQ Managed File Transfer for z/OS had been installed.
  • ++bfg_data++ to be the USS directory where my IBM MQ Managed File Transfer for z/OS configuration would be stored.
  • ++service_type++ to the word AGENT
  • ++agent_name++ to be the name of my agent.
The ++<parameter_name>++ entries need to be replaced with specific values.
The ++<parameter_name>++ entries had to be replaced with the specified values for my environment.

Some of the entries, such as ++options++ required for the CLEAN_AGENT_PROPS, were not needed and so were removed.

If a parameter is not required, the ++<parameter_name>++ can be deleted.
The armElement, productId and CLEAN_AGENT_PROPS properties were not needed for my agent, and so the ++<parameter_name>++ entries for these properties were deleted.

A complete list of all of the parameters in the BFGCUSTM member, along with a description of what values they should have, can be found in the Before you start topic in the IBM MQ V9.1.x section of IBM Knowledge Center.

Step 3: Submit the BFGCUSTM JCL

After the BFGCUSTM JCL had been updated, I submitted it and then exited the library in ISPF. This was important, as the BFGCUSTM job was going to update the library and couldn’t do that while the library was open. After about 20 seconds, the job completed successfully. Looking at the joblog, I saw a number of messages indicating that new members had been created within the library.

BFGCUSTM creates new members for an agent.
When the BFGCUSTM member was submitted, it created a number of new members for my agent.

Each of these members contained JCL that could be used to perform specific tasks for my agent. The topic z/OS agent and logger command JCL scripts in the IBM MQ V9.1.x section of IBM Knowledge Center has a list of these members, along with the IBM MQ Managed File Transfer commands that they correspond to.

Step 4: Submit BFGAGCR to create the agent

The new member BFGAGCR contained some JCL that would create my agent by invoking the fteCreateAgent command. Opening up the member, I noticed that it had been populated with the name of my agent, the agent queue manager and the coordination queue manager for the Managed File Transfer topology, which was pretty good!

The BFGAGCR member had been created with the required parameters filled in.
The BFGAGCR member had been created with the agent name, agent queue manager name and coordination queue manager name filled in.

I then submitted the member. When it ran, it:

  • Created the required configuration files for my agent.
  • Connected to the agent queue manager and created the system queues that the agent needed, using CSQUTIL.
  • Registered the agent with the coordination queue manager.

Step 5: Start the agent by submitting BFGAGST

The final step was to start the agent. In order to do this, I submitted the BFGAGST member, which had been prefilled with my agent name.

The BFGAGST member was created with the agent name already filled in.
The BFGAGST member was created with the agent name already filled in.
The job completed successfully, and the joblog contained the messages:

BFGAG0058I: The agent has successfully initialized. 
BFGAG0059I: The agent has been successfully started.

which meant that my agent was up, running and ready to perform managed transfers! I then went for a well earned cup of tea…

As always, I hope this helps! If you have any questions on this, let me know and I’ll be happy to answer them.

2 comments on"How do I create JCL for my MFT for z/OS agents?"

  1. Someone found your article very useful – see reply on my tweet https://twitter.com/MoragHughson/status/1067761293933846528

    • Paul_Titheridge November 29, 2018

      Hi Morag,

      Thanks for passing along the feedback. Its always nice to know that people read the things I write, and even better to hear that they find them really helpful!

      Paul

Join The Discussion

Your email address will not be published.