Change PF Trigger (CHGPFTRG)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Change Physical File Trigger (CHGPFTRG) command changes the state of one or all triggers for a file. The triggers have been defined with either the SQL CREATE TRIGGER or the Add Physical File Trigger (ADDPFTRG) command.

The state of a trigger can be changed to disabled (stopped from being called during I/O operations) or, if it has been disabled, to enabled (called during I/O operations again). The alternative to changing the state of the trigger is to remove it when you do not want it to be called, and add it again when you need it.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
FILE File Qualified object name Required, Positional 1
Qualifier 1: File Name
Qualifier 2: Library Name, *LIBL, *CURLIB
TRG Trigger Character value, *ALL Required, Positional 2
TRGLIB Trigger library Name, *ALL, *CURLIB Optional
STATE Trigger state *SAME, *ENABLED, *DISABLED Optional
Top

File (FILE)

Specifies the file for which a trigger is to be changed. The file must be a physical file.

This is a required parameter.

Qualifier 1: File

name
Specify the name of the physical file.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*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.
name
Specify the name of the library to be searched.
Top

Trigger (TRG)

Specifies the name of the trigger to be changed.

*ALL
All of the triggers for the file are changed.

Note: When *ALL is specified, all triggers defined for the file will be changed. Any value specified for the Trigger library (TRGLIB) parameter will be ignored.

character-value
Specify the name of the trigger.

Note: The case is preserved when lowercase characters are specified.

Top

Trigger library (TRGLIB)

Specifies the library for the trigger to be changed.

*ALL
All triggers in all trigger libraries will be used.
*CURLIB
The current library for the job is used. If no library is specified as the current library for the job, the QGPL library is used.

Note: The special value *CURLIB is the value of the job running when the trigger is changed.

name
Specify the name of the library to be used.
Top

Trigger state (STATE)

Specifies the state to which the trigger is to be changed. You can use this parameter to temporarily stop a trigger from being called (disable), or to make a trigger that was previously disabled called again during I/O operations (enable).

*SAME
The value does not change.
*ENABLED
The trigger that was disabled will be called during I/O operations again.
*DISABLED
The trigger will not be called during I/O operations.
Top

Examples

CHGPFTRG   FILE(ADMN/PERSONNEL)  TRG(*ALL)  STATE(*DISABLED)

This command disables all triggers for the PERSONNEL file in the ADMN library.

The following command causes all triggers to be called again:

CHGPFTRG   FILE(ADMN/PERSONNEL)  TRG(*ALL)  STATE(*ENABLED)

Top

Error messages

*ESCAPE Messages

CPF32C6
Trigger operation not successful.
Top