Pre/Post Commands

The following table describes the pre submit commands and pre/post commands parameters. You can add, delete, move up or down, copy or edit pre submit and pre and post commands.

NOTE: Pre-submit, Pre commands, post commands and pre statistics are only available for Program, Script File and Command.

Pre submit commands

Description

Pre submit commands

Enables you to define a command before you submit the Job. A Job can have any number of pre submit commands but the total number of variables for a Job is limited. All Pre-submit commands are executed before the Job is submitted to the OS/400.

NOTE: Pre-submit commands are processed in the order they are displayed in the OS/400. Pre/Post Commands dialog box. Pre-submit commands are executed "as is." There is no need for special ‘single quote’ handling.

If a Pre-submit command fails, the failure is ignored, logged in the Agent log file, and the next Pre-submit command is processed. When there are no more Pre-submit commands to process, the Job is submitted. You can add, delete, edit copy, or move up or down any pre-submit command.

Pre Commands

Post Commands

Determines the command line instruction to be executed before or after the specified command line. The following rules apply to Pre and Post commands:

  • A maximum of 19 Pre and Post commands can be defined for a single Job. If a Pre or Post command is defined for a Job, the Job is processed as a Script file object type, regardless of its defined object type.
  • If the defined Object type is CMDLINE, the Command line (in the OS400 tab) cannot exceed 256 characters.
  • The Job processes all the Pre commands in the order they are displayed in the OS/400 Pre/Post Commands dialog box, then the command line or the program (depending on "What to run"), and then all the Post commands in the order they are displayed in the OS/400 Pre/Post Commands dialog box.
  • If a Pre command, or the command line or program, or a Post command fails, the Job will fail, unless the next command to be processed is MONMSG.
  • As the Job is treated as a “Script file”, a Pre or Post command can be any valid “Script file” extended feature.

    EXAMPLE: PGM PARM(&name), RETURN, GOTO, MONMSG, continuation line, or remarks.

  • Default values for "Ignore Errors" (IGNERR keyword) and "Log informational messages" (LOGINFMSG keyword) of the "Script file" interpreter are used.
  • Single quote marks (') must be doubled ('') in Pre or Post commands.

    EXAMPLE: SNDMSG MSG('I am using Control-M') TOUSR(*SYSOPR) should be entered as

    SNDMSG MSG(''I am using Control-M'') TOUSR(*SYSOPR).

Pre statistics

The following rules apply to pre statistics programs:

  • A Job can only have one pre statistics program
  • The parameter pre statistics program must refer to a qualified OS/400 program name in one of the following formats:

    -<Program>

    -<Library>/<Program>

The Pre-statistics field contains the following:

  • Pre statistics program: Specifies the name of a program to the process the Jobs statistic information.
  • Library: Defines the name of the library. 10 characters valid OS/400 object name.

Parent Topic

Advanced parameters for OS/400 Job