If you’ve been an API programmer for a while, you’ve probably encountered situations in which IT operations staff member needed your expertise to help them to provide adequate, timely, and qualified IT assistance to the business that you serve. One area that keeps growing in focus involves the TCP/IP infrastructure on an IBM i platform, which relies on a number of subsystems and server jobs to ensure a stable and well-performing runtime environment for the many clients and applications taking advantage of TCP/IP-based services (e.g., FTP, HTTP, Telnet, SMTP, POP, SNMP).
Locating the root of TCP/IP problems, however, often turns challenging. Starting and running the TCP/IP stack requires a mutual effort from many contributing system jobs, the correlation and function of which aren’t that well documented. Further, how these system jobs name and divide the workload changes from release to release. Based on my experience from recent investigations, I decided to build a utility that would list all TCP/IP startup jobs as well as provide access to relevant CL commands, thus making it easier for the operations staff to monitor and troubleshoot TCP/IP processing jobs. Enabling staff members to proactively spot and remedy issues and failures in the TCP/IP infrastructure increases their efficiency and reduces the negative impact on business activities.
The WRKTCPJOB Command
The net result of my efforts is the Work with TCP/IP Startup Jobs (WRKTCPJOB) command (to download the code bundle, go to iProDeveloper.com/code). WRKTCPJOB is based on the Open List of Jobs (QGYOLJOB) API. This API employs a table containing the names of the jobs on IBM i 7.1 that help start the TCP/IP stack and associated services and interfaces, as per my investigation. (To learn more about the processing of Open List APIs in general and the QGYOLJOB API in particular, see the article “APIs at Work — with Jobs” listed in the “Find Out More” section at the end of this article.)
The WRKTCPJOB command processing program accesses the TCP/IP job table by means of the SQL CLI APIs, which are available at no charge on every IBM i. Some of my previous articles have covered the SQL CLI APIs, but mostly from the perspective of creating tables and writing data to the tables as required by CL commands that provide an *OUTFILE output option. In this article, I’ll show you how to employ the SQL CLI APIs to read the table data in an ILE RPG program, and how to create and populate the table in question by using SQL DDL source statements executed by the Run SQL Statements (RUNSQLSTM) command (or any other SQL statement processing interface, for that matter).
Download the save file containing the source code.