Two CL Commands You Should Know

CL
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

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:

http://www.mcpressonline.com/articles/images/2002/Two%20CL%20Commands%20You%20Should%20Know00.jpg

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.

http://www.mcpressonline.com/articles/images/2002/Two%20CL%20Commands%20You%20Should%20Know01.jpg

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.

BOB COZZI

Bob Cozzi is a programmer/consultant, writer/author, and software developer. His popular RPG xTools add-on subprocedure library for RPG IV is fast becoming a standard with RPG developers. His book The Modern RPG Language has been the most widely used RPG programming book for more than a decade. He, along with others, speaks at and produces the highly popular RPG World conference for RPG programmers.


MC Press books written by Robert Cozzi available now on the MC Press Bookstore.

RPG TnT RPG TnT
Get this jam-packed resource of quick, easy-to-implement RPG tips!
List Price $65.00

Now On Sale

The Modern RPG IV Language The Modern RPG IV Language
Cozzi on everything RPG! What more could you want?
List Price $99.95

Now On Sale

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: