 |
 |
| iSeries 400 Tips: |
|
Understanding the basics of the command definition language
Command objects are created using a special language called the command definition language. Command definition statements are entered into a source member using SEU just as program code is. The default source file name is QCMDSRC, and the appropriate member type to use is CMD.
There are six command definition statements. We will cover the three most frequently used , which themselves can be used to create all but the most complicated
To continue reading for free, register below or login
To read more you must become a member of Search400.com
');
// -->

commands. The three basic command definition statements are as follows:
Command definition statements can be prompted in SEU using F4. The resulting prompt screens for command definition statements are identical to the prompt screen you get when you prompt a CL command in SEU or on a command line. (In fact, you can prompt any of the command definition statements while on a command line even though they are not executable commands.)
Sample code: The CRTMIPGM command
These two programs -- crtmipgm0.clp and crtmipgm1.rpg -- compose a bare-bones preprocessor for the MI compiler, which is accessed using the QPRCRTPG API. The QPRCRTPG API does not accept a source file name or member. Instead, it expects the MI code that you want compiled to be in a one long character string. This makes it very inconvenient -- actually nearly impossible -- to use by itself, thus requiring a preprocessor to read your source member and copy it into one long string.
The preprocessor makes the QPRCRTPG API usable; however, the parameter list of the preprocessor is still rather complicated. This makes it a perfect candidate for a command interface. The code shown here is the command definition statements for a command interface to the main program of the preprocessor, namely the CL program CRTMIPGM0.
Take some time to digest all this code. In the next installment, we will discuss the command definition source.
-----------------------------------
About the author: Ron Turull is editor of Inside Version 5. He has more than 20 years' experience programming for and managing AS/400-iSeries systems.

|