APIs by Example: Commands and Utilities--API Examples Revisited

Article ID: 56959

The APIs by Example column provides useful coding examples of the many different APIs and API types that IBM provides in increasing numbers for each i5/OS release. The original idea was to establish a library of API samples for you to use as a starting point when faced with a programming challenge involving APIs. Over time, this intention has grown into putting the APIs in the context of CL commands and utilities in an attempt to add a practical and hopefully inspiring context to the many API code samples.

Today, I reverse the spotlight and cover the many commands and utilities that this column has introduced over the years. Although the APIs I mentioned in the titles and discussed in the articles might not have caught your eye back then, there's still a chance that the commands could be useful, whether directly or in adapted form. So I've spent a little time in the archives digging up more than 50 previously published API-based CL commands and utilities with the intention of giving you the opportunity of breathing new life into them.

Here are links to all the programmer and system commands and utilities published in the APIs by Example column between 2004 and 2007, all headed by a brief description taken from the respective command's help text. Each link takes you to an article that presents a utility and provides a zip file that you can download with the source code.

Generate Command Help Command (GENCMDHLP)--January 15, 2004
The generate command help command creates a help panel group skeleton based on the specified command source member. The created panel group source reflects the command definition attributes such as keyword, type of value, default value, special values, valid values, and single values, as well as parameter requirement and restriction.
http://systeminetwork.com/article/club-tech-iseries-programming-tips-newsletter-35

Display IFS File Lock (DSPIFSLCK)--March 25, 2004
Displays access and lock information for a specific IFS object. This information includes the type of lock or access as well as a list of the jobs holding the lock(s).
http://systeminetwork.com/article/club-tech-iseries-programming-tips-newsletter-43

Find File Member Library (FNDMBR)--May 20, 2004
The FNDMBR command searches the job library list to locate all files by the specified file name. Each file is subsequently searched for the specified member name. The search continues until a member name match is found or until all files have been searched. If the specified member is located, either a completion message specifying the library and file name containing the member is sent, or the WRKMBRPDM (Work with Members Using PDM) command is issued against the member.
http://systeminetwork.com/article/club-tech-iseries-programming-tips-newsletter-49

Check Object Authority (CHKOBJAUT)--June 10, 2004
The Check Object Authority (CHKOBJAUT) command checks that objects in the specified library match the specified authorization and ownership profile. The result of this authorization analysis is written to a printer file placed in the current job's output queue.
http://systeminetwork.com/article/apis-example-check-object-authority

Check Job Queue Status (CHKJOBQSTS)--July 29, 2004
The Check Job Queue Status (CHKJOBQSTS) command checks the current status of the job queues defined or allocated to one (or all) active subsystem(s). An informational message is returned for each job queue that is held, is damaged, or has been defined to a subsystem but not yet created.
http://systeminetwork.com/article/apis-example-check-job-queue-status

Print File Field Description (PRTFFD)--September 9, 2004
The Print File Field Description (PRTFFD) command prints database file field-level information for the specified file. This information includes data type, length, buffer position, and check values as well as key field specification and, for logical files, any select/omit criteria specification.
http://systeminetwork.com/article/apis-example-print-file-field-description

Create User Index (CRTUSRIDX)--September 23, 2004
The Create User Index (CRTUSRIDX) command creates a user index and stores it in either the user domain or the system domain.
http://systeminetwork.com/article/apis-example-user-index-apis-part-one

Convert Display File Constants (CVTDSPFCNS)--October 14, 2004
The Convert Display File Constants (CVTDSPFCNS) command converts all display file source constants to message descriptions. This procedure lets you externalize the display file texts, subsequently enabling you to translate the texts and thereby support different languages in your application screens.
http://systeminetwork.com/article/apis-example-user-index-apis-part-two

Manage Journal Receivers (MNGJRNRCV)--October 28, 2004
The Manage Journal Receivers (MNGJRNRCV) command is used to count or delete the journal receivers matching the specified selection criteria.
http://systeminetwork.com/article/club-tech-iseries-programming-tips-newsletter-17

Change IFS Attributes (CHGIFSATR)--November 18, 2004
The Change IFS Attributes (CHGIFSATR) command changes one or more of the specified IFS object's attributes. The current attribute value is displayed when the command is prompted.
http://systeminetwork.com/article/apis-example-change-ifs-attributes

Override Group Profile (OVRGRPPRF)--December 16, 2004
The Override Group Profile (OVRGRPPRF) command temporarily replaces the current job's primary group profile with the specified group profile. At release V5R1 and earlier, any special or object authority coming from the replaced group profile is suspended during this replacement. Likewise, any object or special authority provided by the new group profile is activated while the override is in effect.
http://systeminetwork.com/article/club-tech-iseries-programming-tips-newsletter-18

Add Profile Authorization Code (ADDPRFAUT)--January 20, 2005
The Add Profile Authorization Code (ADDPRFAUT) command registers the authorization code required by the Override Group Profile (OVRGRPPRF) command to perform a group profile override. The authorization code is registered to a specific user profile and group profile combination and can be used only by that user profile to temporarily replace a job's current primary group profile with the specified group profile.
http://systeminetwork.com/article/club-tech-iseries-programming-tips-newsletter-28

Analyze Activation Groups (ANZACTGRP)--February 10, 2005
The Analyze Activation Groups (ANZACTGRP) command produces a report that contains information about one or more activation groups currently active in the specified job. This includes information about the activation group itself, as well as information about the programs currently activated within each activation group. The gathered information is written to a spooled file and placed in the current job's default output queue.
http://systeminetwork.com/article/club-tech-iseries-programming-tips-newsletter-21

Monitor Batch Jobs (MONBCHJOB)--March 17, 2005
The Monitor Batch Jobs (MONBCHJOB) command lets you monitor one or all subsystems for active batch jobs currently not running, either due to being held or to waiting for a message to be replied to. The job queue to which a job initially was submitted can be specified as a further selection criteria.
http://systeminetwork.com/article/apis-example-monitor-batch-job-utility

Retrieve Authority (RTVAUT)--March 31, 2005
The Retrieve Authority (RTVAUT) command retrieves the authorities that a user has to the specified IFS object.
http://systeminetwork.com/article/apis-example-profile-authorization-management

Change Object Attributes (CHGOBJATR)--May 12, 2005
The Change Object Attributes (CHGOBJATR) command changes one or more of the specified object's attributes. The current attribute values are displayed when the command is prompted.
http://systeminetwork.com/article/apis-example-change-object-attributes-command

Retrieve ASP Information (RTVASPINF)--May 26, 2005
The Retrieve ASP Information (RTVASPINF) command returns information about the specified ASP's basic attributes.
http://systeminetwork.com/article/apis-example-retrieve-asp-information-part-1

Retrieve Disk Attributes (RTVDSKATR)--June 16, 2005
The Retrieve Disk Attributes (RTVDSKATR) command returns information about all configured disk units on a system.
http://systeminetwork.com/article/apis-example-retrieve-asp-information-part-2

Add Function Registration (ADDFCNREG)--August 11, 2005
The Add Function Registration (ADDFCNREG) command registers a function with the registration facility. The command parameters provide information to help manage and control the use of the function.

Remove Function Registration (RMVFCNREG)
The Remove Function Registration (RMVFCNREG) command removes a function previously registered with the registration facility.
http://systeminetwork.com/article/apis-example-user-function-registration-apis-part-1

Change User Function Usage (CHGUSRFCNU)--August 25, 2005
The Change User Function Usage (CHGUSRFCNU) command changes the usage information for a function. The usage information for a function indicates which user profiles are allowed or not allowed to use a function.

Retrieve Function Usage (RTVFCNUSG)
The Retrieve Function Usage (RTVFCNUSG) command checks whether a user is allowed to use the specified function and returns an indication of whether the user is allowed to use the function.
http://systeminetwork.com/article/apis-example-user-function-registration-apis-part-2

Change User Status (CHGUSRSTS)--September 15, 2005
The Change User Status (CHGUSRSTS) command can reset a user profile password as well as change a user profile status to *ENABLED.
http://systeminetwork.com/article/apis-example-user-function-registration-apis-part-3

Work with Command Log (WRKCMDLOG)--May 18, 2006
The Work with Command Log (WRKCMDLOG) command lets you work with a list of previously entered commands, retrieved from the current job's job log. All request messages in the job log are retrieved.
http://systeminetwork.com/article/apis-example-user-interface-manager-apis

Work with Subsystem Activity (WRKSBSACT)--June 8, 2006
The Work with Subsystem Activity (WRKSBSACT) command lets you monitor and manage the subsystem activity on your system.
http://systeminetwork.com/article/apis-example-uim-work-management-apis-part-1

Work with Subsystem Job Queues (WRKSBSJOBQ)--June 22, 2006
The Work with Subsystem Job Queues (WRKSBSJOBQ) command lets you monitor activity in, and work with, all job queues currently allocated to the specified subsystem, but only if that subsystem is currently active. For inactive subsystems, no job queues are listed.
http://systeminetwork.com/article/apis-example-uim-work-management-apis-part-2

Work with Job Queue Jobs (WRKJOBQJOB)--July 13, 2006
The Work with Job Queue Jobs (WRKJOBQJOB) lets you work with all jobs that have been submitted through the specified job queue and that have not yet completed. This implies that only jobs currently on the specified job queue--or that have been on that job queue and are currently active--are included in the list of jobs to work with.
http://systeminetwork.com/article/apis-example-uim-work-management-apis-part-3

Display Authorization List IFS Objects (DSPAUTLIFS)--August 17, 2006
The Display Authorization List IFS Objects (DSPAUTLIFS) command displays the list of objects secured by the authorization list specified on the Authorization list prompt (AUTL parameter).
http://systeminetwork.com/article/apis-example-authorization-list-apis-and-secured-objects-part-2

Work with Referenced Job Descriptions (WRKREFJOBD)--August 31, 2006
The Work with Referenced Job Descriptions (WRKREFJOBD) command lists all job descriptions that match the specified selection criteria and enables you to run job description commands, such as display, change, and delete job description, against one or more of the listed job descriptions.
http://systeminetwork.com/article/apis-example-retrieve-job-description-information-api

Work with Routing Entries (WRKRTGE)--September 21, 2006
The Work with Routing Entries (WRKRTGE) command lets you work with all routing entries defined for the specified subsystem.
http://systeminetwork.com/article/apis-example-retrieve-subsystem-entries-api

Display Locale Time of Day (DSPLOCTOD)--October 12, 2006
The Display Locale Time of Day (DSPLOCTOD) command displays in a window the current local timestamp as defined by the specified locale.
http://systeminetwork.com/article/apis-example-locales-apis-and-time-zones

Enable Proxy ARP (ENBPXYARP)--October 26, 2006
The Enable Proxy ARP (ENBPXYARP) command is used to change the Proxy ARP Allowed setting for an IPv4 interface.

Change IPv4 Interface (CHGIP4IFC)
The Change IPv4 Interface (CHGIP4IFC) command is used to change selected parameters for an IPv4 interface that is defined in the system's TCP/IP configuration.
http://systeminetwork.com/article/apis-example-apis-and-cl-command-interfaces

Display Data Queue Description (DSPDTAQD)--November 16, 2006
The Display Data Queue Description (DSPDTAQD) command displays information about the specified data queue. The type of information varies depending on the type of data queue.

Send Data Queue Entry (SNDDTAQE)
The Send Data Queue Entry (SNDDTAQE) command adds an entry to the specified data queue. When an entry is sent to a standard data queue, the storage allocated for each entry will be the value specified for the maximum entry length on the Create Data Queue (CRTDTAQ) command.

Clear Data Queue (CLRDTAQ)
The Clear Data Queue (CLRDTAQ) command clears all data from the specified data queue or clears messages that match the key specification from a keyed data queue.
http://systeminetwork.com/article/apis-example-data-queue-apis-and-cl-commands

Copy Data Queue Description (CPYDTAQD)--December 14, 2006
The Copy Data Queue Description (CPYDTAQD) command creates a new data queue based on the attributes of an existing data queue.
http://systeminetwork.com/article/apis-example-data-queue-apis-and-cl-commands-part-2

Display Data Queue Entries (DSPDTAQE)--January 18, 2007
The Display Data Queue Entries (DSPDTAQE) command lets you display a list of all entries currently in the specified data queue. The information includes key data for keyed data queues, provided that either the sequence parameter special value *BYKEY or *DTAQTYP is specified.
http://systeminetwork.com/article/apis-example-data-queue-apis-and-cl-commands-part-3

Work with Data Queues (WRKDTAQ2)--February 8, 2007
The Work with Data Queues (WRKDTAQ2) command lets you list and manage the selected data queue.
http://systeminetwork.com/article/apis-example-data-queue-apis-and-cl-commands-part-4

Run Data Queue Server (RUNDTAQSVR)--February 22, 2007
The Run Data Queue Server (RUNDTAQSVR) command runs the server side of the Display TCP/IP Servers (DSPTCPSVR) command.

Display TCP/IP Servers (DSPTCPSVR)
The Display TCP/IP Servers (DSPTCPSVR) command displays a list of all currently configured TCP/IP servers on the system. The RUNDTAQSVR command must be active for the DSPTCPSVR to function.
http://systeminetwork.com/article/apis-example-data-queue-apis-and-cl-commands-part-5

Work with Autostart Job Entries (WRKAJE)--March 29, 2007
The Work with Autostart Job Entries (WRKAJE) command lets you work with all autostart job entries defined for the specified subsystem.

Submit Job Description Job (SBMJOBDJOB)
The Submit Job Description Job (SBMJOBDJOB) command submits a job based on the job attributes and job information defined in the specified job description.
http://systeminetwork.com/article/apis-example-automatically-starting-jobs-and-running-programs-your-system

Display Target Releases (DSPTGTRLS)--April 26, 2007
The Display Target Releases (DSPTGTRLS) command displays a list of releases being supported by the current release's save commands. The save commands being referred to are the Save Library (SAVLIB) and Save Object (SAVOBJ) commands.

Retrieve Target Release (RTVTGTRLS)
The Retrieve Target Release (RTVTGTRLS) command retrieves the VxRxMx (where x is a digit from 0 through 9) release identifier of the specified release special value.

Check Target Release (CHKTGTRLS) The Check Target Release (CHKTGTRLS) command verifies that the specified target release is valid and supported by the save commands of the current release.
http://systeminetwork.com/article/apis-example-valid-target-release-levels-save-commands

Work with Server Authentication Entries (WRKSVRAUTE)--May 10, 2007
The Work with Server Authentication Entries (WRKSVRAUTE) command creates a list of server authentication entries for all or a subset of user profiles. The list panel offers options to create, change, display, or remove one or more authentication entries.
http://systeminetwork.com/article/apis-example-making-connection-server-authentication-entries

Display Command Help (DSPCMDHLP)--June 14, 2007
The Display Command Help (DSPCMDHLP) command displays a specific section of the help text associated with the specified command.

Generate UIM Help Source (GENUIMHLP)
The Generate UIM Help Source (GENUIMHLP) command provides a simple interface to the GENCMDDOC command.
http://systeminetwork.com/article/apis-example-do-you-need-help

Save Library List (SAVLIBL)--July 12, 2007
The Save Library List (SAVLIBL) command retrieves the job's product libraries, current library list, and user library list and stores this information with the user profile specified. The library list information is stored in a special area that is saved and restored with the user profile.

Restore library list (RSTLIBL)
The Restore library list (RSTLIBL) command restores library list information from the user profile specified and changes the library list of the job running the RSTLIBL command to reflect the restored library list.
http://systeminetwork.com/article/apis-example-library-list-management

Generate SQL Data Definition Language (GENSQLDDL)--August 9, 2007
The Generate SQL Data Definition Language (GENSQLDDL) command generates the SQL data definition language statements required to recreate a database object. The results are returned in the specified database source file member.
http://systeminetwork.com/article/apis-example-reverse-engineering-database-files-and-objects-sql-ddl-statements

Display Physical File Access Paths (DSPPFAP)--September 13, 2007
The Display Physical File Access Paths (DSPPFAP) command displays all access paths generated over the specified physical file. This information includes key fields, key sequence, and select/omit criteria.
http://systeminetwork.com/article/apis-example-displaying-and-locating-physical-files-access-paths

Work with Database Files (WRKDBF)--October 11, 2007
The Work with Database Files (WRKDBF) command lets you list and manage the selected database files.

Display File Field Description (DSPFFD2)
The Display File Field Description (DSPFFD2) command lets you display a list of the fields in the specified database file.
http://systeminetwork.com/article/apis-example-working-database-files-fields-and-more

Next time around, APIs by Example will again turn its focus to the API topic, but even so, if you have any ideas for a useful programmer tool or command that you would like me to cover in this newsletter, please drop me an email briefly describing your suggestion. If you have any questions or comments concerning the list of commands and utilities that I summarized here, please don't hesitate to contact me at flensburg@novasol.dk

ProVIP Sponsors

ProVIP Sponsors