APIs by Example: Automatically Starting Jobs and Running Programs on Your System

Writing certain types of programs and utilities (e.g., server programs, monitor facilities, any other never-ending processes) presents you with the challenge of starting the programs at some point. In some cases the system job scheduler takes care of this requirement; the Add Job Schedule Entry (ADDJOBSCDE) and Work with Job Schedule Entries (WRKJOBSCDE) commands let you easily set up jobs to run regularly.

Sometimes, however, you need to ensure that a specific program is running and available at all times whenever your system or specific subsystem is active. In such cases, adding an autostart job entry to the appropriate subsystem often comes in very handy. Contrary to the job scheduler solution, however, only the most basic commands exist to set up and handle autostart job entries.

APIs and some programming effort can make a difference. Two new CL commands are targeted at setting up and testing autostart job entries: Work with Autostart Job Entries (WRKAJE) and Submit Job Description Job (SBMJOBDJOB).

Download the save file containing the source code.

Read the entire article

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s