Work with License Info (WRKLICINF)
Often, programmers don't know what release a particular system is running (too bad there's not a DSPVER command). The easiest way to view this information is to use the Work with License Info (WRKLICINF) command, which displays the version/release level for any specific licensed program or *ALL if you don't really care. Interestingly, IBM uses the term "License Term" instead of "Release Level" on this display. I guess we now have lawyers designing user-interface display panels for us.
In addition to the release level, the system serial number and processor group are displayed nicely at the top of the screen. Figure 1 shows the WRKLICINF results for my own system:
Figure 1: WRKLICINF displays the version/release/module level for any specific licensed program as well as the system serial number and processor group.
So the next time a vendor asks you what release you're running or what your serial number and processor group are, you can answer right away. Now, if IBM would only include the processor feature code (who know why some vendors ask for that goofy thing).
Work with Environment Variables (WRKENVVAR)
The second useful command I want to discuss is the Work with Environment Variables (WRKENVVAR) command. It displays a list of environment variables. From this display, you can add, change, delete, and print these variables.
An environment variable is a variable that has been stored in the job's environment. The environment is sort of a UNIX version of the local data area. The difference of course is that the environment is not a data area, it has no predefined size, and data stored in it is accessed by name instead of positions. I would use only the environment in future applications and never use the local data area again.
There is also a system-wide environment, and it too can be viewed using WRKENVVAR. Specify LEVEL(*SYS) to view or work with the system-level environment; otherwise, the job-level environment is displayed.
Figure 2 shows the WRKENVVAR produced on my system for my interactive job after having just signed on and run no applications.
Figure 2: This example shows the WRKENVVAR produced on my system.
The environment is used heavily by UNIX applications running on the iSeries. In addition, all CGI/Web applications use the environment to communicate with the Web browser. There are also ADDENVVAR, CHGENVVAR, and RMVENVVAR commands to add, change, and remove these variables, respectively.
The two CL commands featured in this article are often overlooked in the 1300+ CL commands shipped with the operating system. But they're certainly worth knowing.
Bob Cozzi is a programmer/consultant, writer/author, and software developer of the RPG xTools, a popular add-on subprocedure library for RPG IV. His book The Modern RPG Language has been the most widely used RPG programming book for nearly two decades. He, along with others, speaks at and runs the highly popular RPG World conference for RPG programmers.
LATEST COMMENTS
MC Press Online