The QUSRTOOL library is optionally installable as `Option 7' of the base operating system when using the RSTLICPGM CL command. On the GO LICPGM menu it is known as `Example Tools Library'.
The spawn example shows how you might write a CL command and a command processing program to allow you to spawn jobs from the AS/400 command line. The call to spawn() will start a new process, allowing you to inherit the current environment (file and socket descriptors, environment variables) from the current process. By default, it allows thread creation in the child process, and allows you to automatically issue the commands required to debug the spawned child. If you want more functionality from the command, it can easily be added.
Creating the SPAWN command
To create these examples, see the QATTINFO file in the QUSRTOOL library. The members AAAAREADME and AAAMAP in that file contain information and instructions for unpacking various QUSRTOOL examples and utilities. Read these members and follow the instructions for the use of the package and unpackage utilities on the SPAWN source files.
The member that contains the SPAWN example information is TP0ZINFO in the QATTINFO file. The TP0ZINFO member contains a table which lists the source files which must be unpacked to create the SPAWN example. The TP0ZINFO member also contains instructions for creating the example CL command, and lists which source members are used for SPAWN in case you want to modify the SPAWN CL command to suit your own specific needs.