Newsletters   Subscriptions  Forums  Store   Career  Media Kit  About Us  Contact  Search   Home 
fhg
Volume 5, Number 11 -- March 16, 2005

Admin Alert: Using OS/400 Autostart Jobs for Repetitious Server Processing


by Joe Hertvik


Most OS/400 shops have a need to run permanent server jobs that handle repetitious processing requests for system users. These jobs need to start whenever an OS/400 subsystem servicing a specific workload begins; they answer user processing requests, and they always need to be running. Fortunately, IBM provides an autostart jobs feature that is useful for creating and running OS/400-based server jobs.


As the name implies, autostart jobs are attached to specific OS/400 subsystems and they start automatically whenever their associated subsystem is started, which makes them perfect candidates to run subsystem initialization jobs. They can also perform repetitive work or function as a communication, subsystem, or software server.

You need two things to attach an autostart job to a subsystem: a job description that describes the job parameters and the processing environment the job runs in; and an autostart job entry to attach to your target subsystem.

For an autostart job, a job description contains all the runtime environment parameters needed to run the job. Job descriptions are created on the green screen by running the Create Job Description command (CRTJOBD). While CRTJOBD contains too many parameters to cover in this article, the following critical parameters must be entered in order to successfully run your job:

  • Job Queue (JOBQ): This parameter must equal one of the job queues associated with the subsystem the autostart job will run in.
  • Routing data (RTGDTA): For most autostart job descriptions, the routing data field should contain the 'QCMDI' literal, which tells OS/400 to run the command string by using the OS/400 command processor program, QCMD.
  • Request Data or Command (RQSDTA): Here you put in the actual command string that OS/400 should execute in order to run your program. This can be a standard Call Program command (CALL), another CL command, or an API program.
  • Initial Library List (INLLIBL): Here you enter the library list that your server job uses while it executes the requested command.

There are other parameters that you can define for your autostart job description, but these are the critical pieces. Given this, a typical CRTJOBD command for creating an autostart job might look like this:

CRTJOBD JOBD(library/job description name) JOBQ(library/job_queue_name) RTGDTA(QCMDI) RQSDTA('command_string') INLLIBL(library1 library2)

Once the job description is created, it is a simple matter to create an autostart job entry that attaches the job description to your subsystem description, so that the job is autostarted whenever the subsystem is started. You can add an autostart job entry to a subsystem by using the Add autostart Job Entry command (ADDAJE), like this:

ADDAJE SBSD(library /subsystem name) JOB(job_name) JOBD(library/job description name)

Where each parameter defines the following features of an autostart job:

  • Subsystem Description (SBSD): Defines the subsystem description name and library location of the subsystem you want to attach your autostart job to.
  • Job Name (JOB): The name you want to give the autostart job while it is running in your subsystem.
  • Job Description (JOBD): The job description that contains all the runtime parameters necessary to execute the autostart job.

After the ADDAJE command runs successfully, you will have added an autostart job entry to your target subsystem. Whenever the target subsystem is started, the autostart job described in this entry will launch and run in that subsystem. autostart job entries for a subsystem can be displayed by running the Display Subsystem Description command (DSPSBSD), as shown below, and selecting option 3, Autostart Job Entries, from the menu that appears:

DSPSBSD SBSD(library /subsystem name)


To change an autostart job entry, enter the Change Autostart Job Entry command (CHGAJE) as follows, and press the F4 key to change any of the parameters:

CHGAJE SBSD(library /subsystem name) JOB(job_name) JOBD(library/job description name)

To remove an autostart job entry from a subsystem, use the Remove Autostart Job Entry, like this:

RMVAJE SBSD(library /subsystem name) JOB(job_name)

If you are using an autostart job for subsystem initialization, where the program will run a predetermined number of steps and then terminate, you won't run into many problems. However, if you are using an autostart job as a server job where it will handle multiple requests over a long period of time when the subsystem is running, you may need to restart the job occasionally to reinitialize job parameters. The problem with autostart jobs is that the only way to restart each job is to end and restart the subsystem that runs the job. Because of this, you may want to schedule occasional subsystem restarts in order to refresh your autostart server jobs.

For more information on autostart jobs, see IBM's write-up on the subject in the iSeries Information Center.


Click here to contact Joe Hertvik by e-mail.

Sponsored By
GUILD COMPANIES

The iSeries Express Web Implementer's Guide
by Brian W. Kelly

Setting up WebSphere Express, IBM's business solutions, WebFacing, iSeries Access
for Web, and HATS/LE is a snap with this how-to guide.

WebSphere Express for iSeries is the new free server for all of IBM's iSeries dynamic Web-enabling offerings. Whether your applications are in RPG, COBOL, or Java,
you can now enjoy the benefits of bringing them to the Web.
There's only one small issue: No applications can run unless you first have your WebSphere Application Server Express running.

Learn how to order, install, fix, and run all of IBM's Web application enablers for the iSeries, including: WebSphere Express Server, Apache HTTP Server, WDSc, WebFacing, IBM Telephone Directory, IBM Survey Creator, iSeries Access for the Web, and HATS/LE.

Regular Price $59
Get Your Copy Today!

Shop at the IT Jungle Store
http://store.itjstore.com/imgu.html


Technical Editors: Howard Arner, Joe Hertvik, Ted Holt,
Shannon O'Donnell, Kevin Vandever
Managing Editor: Shannon Pastore
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.


THIS ISSUE
SPONSORED BY:

WorksRight Software
iTera
Guild Companies


BACK ISSUES

TABLE OF
CONTENTS
Rounding Over a Set of Rows

More About the SAVRSTxxx Commands

Admin Alert: Using OS/400 Autostart Jobs for Repetitious Server Processing


The Four Hundred
Open Source Servers

Re-Energizing ISVs Is a Tough Chore for IBM

Book Excerpt: The All-Everything Machine

As I See It: Social Insecurity

Four Hundred Stuff
LANSA Unveils 2005 Version of IDE

Jim Sloan's TAA Toolset Bigger and Better than Ever

Qualcomm Offers New TrailerTRACS Hosting Options

NetManage Positions Software for iSeries Single Sign-On

Four Hundred Monitor


Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc. (formerly Midrange Server), 50 Park Terrace East, Suite 8F, New York, NY 10034
Privacy Statement