How do you create a Job Description (JOBD)?

Job Descriptions (JOBDs) in IBM i (formerly AS400) are essential objects that define the characteristics and environment for running jobs (programs and processes). They act as templates that specify how a job should behave when it's submitted to the system.

Here's how you can create a JOBD:

1. Using the CRTJOBD command:

  • The most common way to create a JOBD is using the CRTJOBD command.
  • You can execute this command from a command line or within a CL program.

Syntax:

CRTJOBD JOBD(library/jobd-name) parameters
  • library: The library where you want to create the JOBD.
  • jobd-name: The name you want to give to the JOBD.
  • parameters: Various parameters that define the JOBD's attributes.

2. Key Parameters:

Here are some of the most important parameters you'll likely use when creating a JOBD:

  • JOBQ: Specifies the job queue where jobs using this JOBD will be submitted.
  • JOBPTY: Sets the priority of jobs using this JOBD.
  • OUTPTY: Sets the priority of spooled output generated by jobs using this JOBD.
  • INLLIBL: Specifies the initial library list for jobs using this JOBD.
  • CURLIB: Specifies the current library for jobs using this JOBD.
  • RTGDTA: Specifies routing data that can be used to route jobs to specific subsystems.
  • TEXT: Provides a description of the JOBD.

3. Example:

CRTJOBD JOBD(MYLIB/MYJOBD) JOBQ(MYLIB/MYJOBQ) JOBPTY(5) OUTPTY(5) INLLIBL(MYLIB, QSYS) TEXT('Job description for batch processing')

This command creates a JOBD named MYJOBD in library MYLIB. Jobs using this JOBD will be submitted to the MYJOBQ job queue, have a job priority of 5, an output priority of 5, an initial library list of MYLIB and QSYS, and a description of "Job description for batch processing."

4. Using WRKJOBD:

  • You can also use the WRKJOBD command to work with job descriptions.
  • This command allows you to display, change, copy, or delete existing JOBDs.
  • You can create a new JOBD by selecting option 1 (Create) on the WRKJOBD display.

5. Important Considerations:

  • Authority: You need sufficient authority to create JOBDs in the specified library.
  • Naming conventions: Follow the naming conventions for IBM i objects when naming your JOBDs.
  • Planning: Carefully plan the attributes of your JOBDs based on the requirements of the jobs that will use them.

By creating and configuring JOBDs effectively, you can:

  • Control the execution environment of your jobs.
  • Manage system resources efficiently.
  • Improve the overall performance of your IBM i system.