ADDEXITPGM (Add Exit Program) Command Description

ADDEXITPGM Command syntax diagram

Purpose

The Add Exit Program (ADDEXITPGM) adds an exit program entry for a specific exit point. Each exit point can have a single entry or multiple entries. The exit program number indicates the sequence in which the exit programs are run.

Required Parameters

EXITPNT
Specifies the exit point name to which the exit program is added. If no exit point by this name exists, and CRTEXITPNT(*YES) is specified, an exit point is created.

FORMAT
Specifies the exit point format name of the exit program that is added.

PGMNBR
Specifies the sequence in which the exit programs are run when multiple exit point programs for a specific exit point are defined.

*LOW: The lowest available number for that specific exit point is assigned.

*HIGH: The highest available number for that specific exit point is assigned.

program-number: Specify the exit program sequence number. Valid values range from 1 through 2147483647. Processing sequence is from the lowest number to the highest number. Exit program numbers do not need to be consecutive.

PGM
Specifies the name of the exit program to be called. The program does not have to exist on the system when this command is run.

The name of the exit program can be qualified by one of the following library values:

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

program-name: Specify the name of the exit program.

Optional Parameters

TEXT
Specifies the text that briefly describes the exit program. More information is in commonly used parameters.

*BLANK: Text is not specified.

*MSGID: The description is taken from the message specified by the MSGID and MSGF parameters. The description is retrieved when exit program information is displayed using the WRKREGINF (Work with Registration Information) command or retrieved using the QusRetrieveExitInformation API.

'description': Specify no more than 50 characters of text, enclosed in apostrophes.

MSGID
Specifies the message identifier that contains the text that describes the exit program. The message is retrieved from the message file specified by the MSGF parameter. This parameter can only be specified if TEXT(*MSGID) is specified.

message-identifier: Specify the seven-character message identifier of the message that describes the exit program.

MSGF
Specifies the message file and library that contains the message specified by the MSGID parameter. This parameter can only be specified if TEXT(*MSGID) is specified.

The name of the message file can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

library-name: Specify the name of the library where the message file is located.

message-file: Specify the name of the message file.

REPLACE
Specifies whether the attributes and data for an exit program entry are replaced. New values for the program and the text or message identifier can be specified. The program name and library cannot be changed.

*NO: The attributes and data for an exit program entry are not replaced.

*YES: The attributes and data for an exit program entry are replaced.

CRTEXITPNT
Specifies whether the exit point is automatically created if it does not already exist.

*NO: The exit point is not created. If the specified exit point does not exist, the exit program is not added and an error message is returned.

*YES: The specified exit point is created.

THDSAFE
Specifies whether the exit program entry is threadsafe. This is intended for documentation purposes only. It may be used in determining the MLTTHDACN value, but there is no direct relation between the THDSAFE and MLTTHDACN keywords.

*UNKNOWN: The threadsafe status of the exit program entry is not known.

*NO: The exit program entry is not threadsafe.

*YES: The exit program entry is threadsafe.

MLTTHDACN
Specifies the multithreaded job action when the exit program is called. It should be used by exit point providers when calling exit programs in a multithreaded job. The THDSAFE attribute of the exit program can be used in determining the mulitple thread action, however, there is no direct relationship between the THDSAFE and MLTTHDACN keywords.

*SYSVAL: Use the QMLTTHDACN system value to determine the action to take.

*RUN: Run the exit program in a multiple threaded job.

*MSG: Run the exit program in a multiple threaded job, but send an informational message. CPI3C80 can be used as the informational message.

*NORUN: Do not run the exit program in a multiple threaded job. Depending on the exit point, do one of the following:

  1. Send an escape message and do not call the exit program. CPF3C80 can be used as the escape message.

  2. Send an informational message and do not call the exit program. CPI3C80 can be used as the informational message.

  3. Call the exit program in a non-multithreaded job.

If you do use the THDSAFE value to determine the value for MLTTHDACN, please read the following recommendations:

  1. If the THDSAFE value is *NO, MLTTHDACN should be set to *NORUN.

  2. If the THDSAFE value is *UNKNOWN, MLTTHDACN should be set to *SYSVAL.

  3. If the THDSAFE value is *YES, MLTTHDACN should be set to *RUN.

PGMDTA
Specifies the data that is passed to the exit program. This data should correspond to the input data defined by the exit point provider.

*NONE: No data is passed to the exit program.

Element 1: CCSID for Program Data

*JOB: The CCSID (coded character set identifier) of the current job is used.

CCSID-for-data: Specify the CCSID associated with the data passed to the exit program.

Element 2: Length of Program Data

*CALC: The length is determined by the number of bytes specified for the third element of this parameter.

length-of-data: Specify the number of bytes of data passed to the exit program.

Element 3: Program Data

program-data: Specify the character or hexadecimal program data to be passed to the exit program. If you specify more program data than the length specified, the program data passed to the exit program is truncated. If you specify less program data than the length specified, the program data passed to the exit program is padded on the right with blanks. You can specify up to 2048 bytes of program data.

Example for ADDEXITPGM

ADDEXITPGM   EXITPNT(USER_EXIT_ONE)  FORMAT(EXIT1)
  PGMNBR(1)  PGM(LIB2/MYPGM)  TEXT(*MSGID)
  MSGID(TXT2345)  MSGF(LIB1/MYMSGF)

This command adds exit program MYPGM in library LIB2 to exit point USER_EXIT_ONE. This is first exit program run for the exit point. The text description for the exit program is retrieved from message TXT2345 in message file MYMSGF in library LIB1. No program data is passed to the exit program.

Error messages for ADDEXITPGM

None


[ Information Center Home Page | Feedback | Back to main CL topic ] [ Legal | AS/400 Glossary ]