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.
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.
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).
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.
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.
Some of the entries, such as ++options++ required for the CLEAN_AGENT_PROPS, were not needed and so were removed.
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.
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!
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 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.