These provide examples of changing default values for commands.
To provide a default value of *NOMAX for the MAXMBRS keyword of command Create Physical File (CRTPF), do the following:
CRTPF FILE(FILE1) RCDLEN(96) MAXMBRS(1) . . CHGCMDDFT CMD(CRTPF) NEWDFT('MAXMBRS(*NOMAX)')
To provide a default value of 10 for the MAXMBRS keyword of the command Create Physical File (CRTPF), do the following:
CRTPF FILE(FILE1) RCDLEN(96) MAXMBRS(*NOMAX) . . CHGCMDDFT CMD(CRTPF) NEWDFT('MAXMBRS(10)')
CRTCLPGM PGM(PROGRAM1) SRCFILE(*LIBL/QCMDSRC) . . CHGCMDDFT CMD(CRTCLPGM) + NEWDFT('SRCFILE(LIB001/FILE001) AUT(*EXCLUDE)')
The following provides a default value of 'Isn't this print text' for the PRTTXT keyword of the command Change Job (CHGJOB). Since the NEWDFT keyword has embedded apostrophes, you must not double these apostrophes, or the process will not run correctly.
CHGJOB PRTTXT('Isn''t this print text') . . CHGCMDDFT CMD(CHGJOB) + NEWDFT('PRTTXT(''Isn''''t this print text'')')
The following provides a default value of QGPL for the first qualifier (library name) of the first list item of the DTAMBRS keyword for the command Create Logical File (CRTLF). The new default value for the second list item of the DTAMBRS keyword (member name) is MBR1.
CRTLF FILE(FILE1) DTAMBRS(*ALL) . . CHGCMDDFT CMD(CRTLF) + NEWDFT('DTAMBRS((QGPL/*N (MBR1)))')
Since *ALL is a SNGVAL (single value) for the entire DTAMBRS list, the defaults of *CURRENT for the library name and *NONE for the member name do not show up on the original command prompt display. The defaults *CURRENT and *NONE can be changed to a new default value but do not show up on the original prompt display because of the *ALL single value for the entire DTAMBRS list.
To create a command that will display the spool files for a job, do the following:
CRTDUPOBJ OBJ(WRKJOB) FROMLIB(QSYS) + TOLIB(MYLIB) NEWOBJ(WRKJOBSPLF) WRKJOBSPLF OPTION(*SPLF) . . CHGCMDDFT CMD(MYLIB/WRKJOBSPLF) + NEWDFT('OPTION(*SPLF)')