Generate UIM source for command help

You can generate online help for commands using the GENCMDDOC command.

As a simpler alternative to learning UIM syntax, you can use the Generate Command Documentation (GENCMDDOC) command. This command allows you to create a file containing UIM source; the file provides a template for the online command help. To create the UIM source, you need to specify *UIM for the GENOPT (Generation Options) parameter. The information used to create the template is retrieved from the command object (*CMD) you specify. Using Generate Command Documentation (GENCMDDOC) to create the UIM source can simplify writing online help for your CL commands.

The following is an example of using the Generate Command Documentation (GENCMDDOC) command to generate a UIM template:

GENCMDDOC   CMD(MYLIB/MYCMD)
            TODIR('/QSYS.LIB/MYLIB.LIB/QPNLSRC.FILE')
            TOSTMF(*CMD)  GENOPT(*UIM)

In the example, the command retrieves information from the command object named MYCMD in library MYLIB and generates UIM source into member MYCMD of source file QPNLSRC in library MYLIB. After the template UIM source has been generated, you will need to edit the UIM source as follows:

Once you've edited the UIM source to tailor it to your command, you can create the online help panel group by using the Create Panel Group (CRTPNLGRP) command. The following is an example of using the Create Panel Group (CRTPNLGRP) command:

 CRTPNLGRP   PNLGRP(MYLIB/MYCMD)
             SRCFILE(MYLIB/QPNLSRC)  SRCMBR(MYCMD)

This command attempts to create a panel group from the UIM source in member MYCMD in source physical file QPNLSRC in library MYLIB. If there are no severe errors found when compiling the UIM source, a panel group (*PNLGRP) object named MYCMD is created in library MYCMD. The command generates a spooled file, which can be viewed to see informational, warning, and severe errors found by the UIM compiler.

Related information
Create Panel Group (CRTPNLGRP) command
Generate Command Documentation (GENCMDDOC) command