Years ago, only IBM could create commands that accepted other commands as parameters. For example, the IF command in CL allows you to put another CL command on the THEN parameter. Not only does this capability allow you to specify a CL command, it also allows you to do what's called second-level prompting.
IBM added a special data type for parameters that supports CL commands and second-level prompting. The data type is *CMDSTR, and it's used in this week's featured command, SAVOBJIFS. (See "Back Up to the IFS.")
Here is the specific command definition statement for the SAVCMD parameter:
PROMPT('SAVxxx command to run')
For the most part, this statement looks just like any other command definition statement, but the data type is *CMDSTR. The *CMDSTR parameter type allows the user to type in any valid CL command. The command is not run by the parameter; instead, it is simply passed as a character string parameter to the command's command processing program. But the system does allow the user to enter the command and prompt the command, and it automatically syntax checks the command.
Previously, there was a command definition parameter type of *CMD. Many people, including yours truly, attempted to create commands using this parameter--but alas, this was reserved for IBM-only commands. I believe it was used when IBM created the IF, ELSE, and MONMSG commands.
A few years ago, IBM began abandoning CL commands in favor of the GUI interface in Client Access. Fortunately, they have since repented and now continue to create new commands and support the CL language itself.
As you create your own CL commands, remember the *CMDSTR parameter type so that when a design calls for a CL command, you'll have the tools to make it happen.
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.



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.
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:
LATEST COMMENTS
MC Press Online