CL Command Reference - CHGPTR

CL Command List > CHGPTR Reference

Description:

The Change Pointer (CHGPTR) command changes the value of a pointer variable in a program. The value of the program pointer specified can be changed to point to a new system object, to a new space pointer address, or to a new offset within a space object. This command is not normally used in high-level language programs.

Restrictions:

1. This command is shipped with public *EXCLUDE authority, and the QSRV user profile has private authority to use the command.

2. This command is valid only for changing program variables that are used as pointers and is valid only in debug mode. To start debug mode, refer to the STRDBG (Start Debug) command.

3. This command cannot be used if the user is servicing another job, and that job is on a job queue, or is being held, suspended, or ended.

4. This command cannot be used to change variables in a bound program.

5. This command cannot be used to change variables that are write-protected or within the system domain, unless the user has *SERVICE special authority.


Examples:

CHGPTR PTR(DATAFILPTR) SYSOBJ(QGPL/MYFILE) OBJTYPE(*FILE)

This command changes the value of the pointer DATAFILPTR that is used in the default program in the debug mode. The pointer value is changed to point to the file called MYFILE, which is stored in the QGPL library.