You can change the default value of a command keyword by using the Change Command Default (CHGCMDDFT) command.
The keyword must have an existing default in order to allow a change to a new default value. You can change either an IBM-supplied command or a user-written command. You must use caution when changing defaults for IBM-supplied commands. The following are recommendations for changing defaults:
Use the Change System Library List (CHGSYSLIBL) command to move the user library ahead of QSYS or any other system-supplied libraries in the library list. This will allow the user to use the changed command without using the library qualifier.
Changes to commands that are needed on a system-wide basis should be made in a user library. Additionally, you should add the user library name to the QSYSLIBL system value ahead of QSYS. The changed command is used system-wide. If you need to run an application that uses the IBM-supplied default, do so by using the Change System Library List (CHGSYSLIBL) command. Doing this removes the special library or library-qualify to the affected commands.
If an IBM-supplied command has new keywords, a copy of the command from a previous release may not run properly.
The following is an example of a CL program that is used to delete the old version and create the new changed command:
PGM DLTCMD USRQSYS/SIGNOFF CRTDUPOBJ OBJ(SIGNOFF) FROMLIB(QSYS) OBJTYPE(*CMD) + TOLIB(USRQSYS) NEWOBJ(*SAME) CHGCMDDFT CMD(USRQSYS/SIGNOFF) NEWDFT('LOG(*LIST)') . . Repeat the DLTCMD, CRTDUPOBJ and CHGCMDDFT for each command you want changed . . ENDPGM
You can track changes you make to CL command defaults for use when you install a new release. To track changes, register an exit program for exit point QIBM_QCA_RTV_COMMAND. The exit program is called when you run the Change Command Default (CHGCMDDFT) command. One of the parameters passed to the exit program is the command string that is being run. You can save the command string to a source file and then compile the source file into a CL program. Finally, you use this program to reproduce the changes you have made to command defaults during the previous release.
The following steps can be used to build the NEWDFT command string for the Change Command Default (CHGCMDDFT) command. The USRQSYS/CRTCLPGM command is used in this example.
CRTDUPOBJ OBJ(CRTCLPGM) FROMLIB(QSYS) OBJTYPE(*CMD) + TOLIB(USRQSYS) NEWOBJ(*SAME)
USRQSYS/CRTCLPGM PGM(PGM1) AUT(*EXCLUDE) + TEXT('Isn''t this nice text')
USRQSYS/CRTCLPGM AUT(*EXCLUDE) + TEXT('Isn''t this nice text')
Remember that you may change only parameters, elements, or qualifiers that have existing default values. Specifying a value for a parameter, element, or qualifier that does not have an existing default value makes no default changes.
CHGCMDDFT USRQSYS/CRTCLPGM AUT(*EXCLUDE) + TEXT('Isn''t this nice text')
CHGCMDDFT USRQSYS/CRTCLPGM 'AUT(*EXCLUDE) + TEXT('Isn''t this nice text')'
CHGCMDDFT USRQSYS/CRTCLPGM 'AUT(*EXCLUDE) + TEXT(''Isn''''t this nice text'')'
Command . . . . . . . . . . : CMD R CRTCLPGM Library . . . . . . . . . : USRQSYS New default parameter string: NEWDFT R 'AUT(*EXCLUDE) TEXT(''Isn''''t this nice text'')'
CHGCMDDFT CMD(USRQSYS/CRTCLPGM) NEWDFT('AUT(*EXCLUDE) + TEXT(''Isn''''t this nice text'')')