CL Command Reference - CHGENVVAR

CL Command List > CHGENVVAR Reference

Description:

The Change Environment Variable (CHGENVVAR) command changes the value for an existing environment variable.

Restriction: You must have *JOBCTL special authority to use this command to change system-level environment variables.


Examples:

Example 1: Change a Job-level Environment Variable

CHGENVVAR ENVVAR(altdir) VALUE(¡¯/mydir/test¡¯)

This command changes the value of the job-level environment variable named altdir to the value /mydir/test. The CCSID that is stored with the environment variable is not changed.



Example 2: Change the CCSID of an Environment Variable

CHGENVVAR ENVVAR(altdir) CCSID(273)

This command changes the CCSID of the job-level environment variable named altdir to 273. The environment variable value is not changed.



Example 3: Set an Environment Variable to Null

CHGENVVAR ENVVAR(LIBPATH) VALUE(*NULL)

This command changes the value of the job-level environment variable named LIBPATH to the null (x¡¯00¡¯) character.




Example 4: Change a System-level Environment Variable

CHGENVVAR ENVVAR(home) VALUE(¡¯/usr/home¡¯) LEVEL(*SYS)

This command changes the value of the system-level environment variable named home to /usr/home.