Some of the tips I've seen on creating your own custom commands required both command source and program source. The method I use only requires command source.
If you run a command often and have to key in the same values for the parms then this is a great method to use. It's easy because once you create your first command it is easy copy it and modify it to create a second.
Key in the command on a command line and enter all the parms. Then copy the command syntax into the clipboard. For example, if you want to display messages in qsysopr with an assistance level of *BASIC it would read like this: DSPMSG QSYSOPR ASTLVL(*BASIC). Paste the command into the constant field for the first parm. The length in parm 1 and the constant value in parm 2 will be the same. I leave the length set to 100 so that when I copy the source I don't need to change the length unless of course you use a command, which has a length greater than 100 characters.
After you paste in the command all that is left to do is compile the command with QCMDEXC as the command processing program (CPP).
CMD PROMPT('Display QSYSOPR Messages') PARM KWD(CMD) TYPE(*CHAR) LEN(100) CONSTANT('DSPMSG QSYSOPR ASTLVL(*BASIC)') PARM KWD(LEN) TYPE(*DEC) LEN(15 5) CONSTANT(100) Compile with QCMDEXC as the program to process the command (CPP).