Brief: Are your users tired of being in the dark, with no help text, when they work with commands you've written? Do you wish you could provide them with contextual, online pop-up window help text like IBM does with its commands? The shortest distance between the dark and the light is this month's utility, CRTCMDHLP.
It's great that every AS/400 comes with a function that allows a programmer to create online help text for his commands. What's not so great is that creating the help text can be a real chore. You're required to use the OS/400 function known as the User Interface Manager (UIM). Although you're probably not familiar with the language, you use UIM panels all the time when you're working with OS/400 (IBM uses UIM for many of the system's display panels).
With the UIM language, you create help text source members which are then compiled. (For command help text, you must also include information from the command source member.) You need to become familiar with UIM before you can create even a single line of help text. Even when you become proficient with the language, you'll soon tire of manually retrieving and including information from your command source members-a tedious and repetitive process.
The Create Command Help (CRTCMDHLP) command presented here makes things easier. It creates a compilable UIM source member based on a command's source definition statements. The basic UIM statements are generated and merged with information from your command source. After CRTCMDHLP is run, all that remains is inserting the help text for the command and its parameters at the designated points within the UIM source member. You only need to key in the help text you want to display for the command and its parameters. Knowledge of UIM is not required. This means even a nonprogrammer could create your help text.
Before I describe the utility, I'll give you an overview of how UIM is used to create help text for commands.
Overview of UIM Command Help
UIM is a tag-based language where source member statements are used to describe display panels. These panels can be used for help text (for commands and for display files), menus, search indexes and even data entry panels. Here, we're only concerned with help text panels for commands.
Help text panels are automatically displayed when the user presses the Help or F1 key. By default, the display is windowed and is dynamically positioned on the screen to avoid overlaying the cursor position before the Help key was pressed. (You can cause the help text to appear as a full screen by changing the User Option [USROPT] parameter of your user profile to *HLPFULL.)
1 illustrates how UIM windowed help text works for the OS/400 Copy File (CPYF) command. For this example, the cursor is located in the first parameter (FROMFILE). The window does not overlay the FROMFILE parameter and the help text contains information concerning the FROMFILE parameter.
Figure 1 illustrates how UIM windowed help text works for the OS/400 Copy File (CPYF) command. For this example, the cursor is located in the first parameter (FROMFILE). The window does not overlay the FROMFILE parameter and the help text contains information concerning the FROMFILE parameter.
The UIM source member is used to create a panel group (type *PNLGRP) with the Create Panel Group (CRTPNLGRP) command. The panel group is then linked to the command-either at command creation time with the Create Command (CRTCMD) command or afterwards with the Change Command (CHGCMD) command. To activate help, enter the qualified name of the panel group in the Help Panel Group (HLPPNLGRP) parameter and enter *CMD in the Help Identifier (HLPID) parameter of either CRTCMD or CHGCMD.
2 illustrates the basic structure of a help panel group source member. This structure is the same for every help panel group, whether it's used for a command or a display file. In fact, much of what you learn about help panels for commands can be used when you create help panel groups for display files.
Figure 2 illustrates the basic structure of a help panel group source member. This structure is the same for every help panel group, whether it's used for a command or a display file. In fact, much of what you learn about help panels for commands can be used when you create help panel groups for display files.
A help panel group is made up of numerous help modules and each module relates to part of the display (e.g., the area of the display where a particular command parameter is located). This is known as contextual help because it is defined for a particular rectangular area of the display. The system senses the area of the display through the position of the cursor.
Look at 3. If the cursor is located anywhere in the shaded area labeled A when the Help key is pressed, the help text defined for parameter A is displayed. If the cursor is located in the shaded area labeled B, the help text for parameter B is displayed.
Look at Figure 3. If the cursor is located anywhere in the shaded area labeled A when the Help key is pressed, the help text defined for parameter A is displayed. If the cursor is located in the shaded area labeled B, the help text for parameter B is displayed.
By default, any area of the display not defined by contextual help uses extended help. (In 3, this would be any place outside the shaded areas.) Think of it as the universal help text for the command and its parameters. Extended help is displayed anytime the user presses the Help key (or F1) with the cursor located outside any contextual help area. Extended help text is also available from a contextual help display through the F2 key.
By default, any area of the display not defined by contextual help uses extended help. (In Figure 3, this would be any place outside the shaded areas.) Think of it as the universal help text for the command and its parameters. Extended help is displayed anytime the user presses the Help key (or F1) with the cursor located outside any contextual help area. Extended help text is also available from a contextual help display through the F2 key.
(For more in-depth information about UIM, see IBM's Guide to Programming Application and Help Displays; "Jazz Up Help with UIM," MC, January 1992; or "Create IBM-style Rolling Menus with UIM," MC, July 1993.)
What CRTCMDHLP Does
The CRTCMDHLP command creates a source member (type PNLGRP) which can be used as a starting point for your command help text. The source member is actually compilable after the command is run; however, it wouldn't contain any meaningful help text at that point.
The source member contains a help module for extended help and a help module for each parameter defined in your command source. The areas of the source member where the help text is to be inserted will be designated by one of the following records:
"INSERT COMMAND LEVEL HELP TEXT..." or "INSERT PARAMETER LEVEL HELP TEXT..."
4 shows a partial listing of a UIM help text source member created by the CRTCMDHLP command.
Figure 4 shows a partial listing of a UIM help text source member created by the CRTCMDHLP command.
The source member will contain only one "INSERT COMMAND LEVEL..." record. It will also contain one "INSERT PARAMETER LEVEL..." record for each parameter included in your command.
The help panel group source member created by this utility is basic. It's not meant to squeeze every bit of information from your command source-only the essential information to get you started. You may want to add some UIM features to the utility to enhance it. For instance, you could create help text for command parameter values, derived from the values specified in the VALUES parameter of the PARM statement of your command source member. You can also modify the panel group source member-manually-any way you want. For example, UIM functions such as search indexes and hypertext can be added to the source.
How to Use It
5 illustrates the CRTCMDHLP command as it is prompted. First, you need to specify the command you want to support with help text. Enter the qualified source physical file name (which defaults to QCMDSRC) where the command source member resides and the name of the member. Next, you need to define where the help text should be stored. Specify the qualified source physical file name (defaults to QPNLSRC) where the generated panel group source member is to be placed and the name you want to give the member. When you run CRTCMDHLP, your skeleton help text is created. Key in the help text for your command and recompile the panel group. Your help text will be available to use.
Figure 5 illustrates the CRTCMDHLP command as it is prompted. First, you need to specify the command you want to support with help text. Enter the qualified source physical file name (which defaults to QCMDSRC) where the command source member resides and the name of the member. Next, you need to define where the help text should be stored. Specify the qualified source physical file name (defaults to QPNLSRC) where the generated panel group source member is to be placed and the name you want to give the member. When you run CRTCMDHLP, your skeleton help text is created. Key in the help text for your command and recompile the panel group. Your help text will be available to use.
Creating the Utility
6 lists the source files for the six source members listed in7- 12. You may not recognize all of the source physical file names. If any of them are not in your library, just create the ones you don't have with the Create Source Physical File (CRTSRCPF) command using the default record length of 92. Using the instructions at the beginning of each figure, compile the source members sequentially in the order they are presented in the figures. The last two source members (CMD006RX and CMDPGSHELL) do not need to be compiled.
Figure 6 lists the source files for the six source members listed in Figures 7- 12. You may not recognize all of the source physical file names. If any of them are not in your library, just create the ones you don't have with the Create Source Physical File (CRTSRCPF) command using the default record length of 92. Using the instructions at the beginning of each figure, compile the source members sequentially in the order they are presented in the figures. The last two source members (CMD006RX and CMDPGSHELL) do not need to be compiled.
How It Works
You do not need to understand how this utility works in order to use it. The explanation that follows is included for the benefit of those interested- especially for anyone who might want to en-hance the utility.
The command processing program (CPP) for the CRTCMDHLP command (see 10) is CMD006CL (see 8). The CPP starts by extracting, formatting and storing information obtained from your command source member through a REXX procedure, CMD006RX (see 11). Input to this procedure is the command source member for your command; output is the CMD006PF physical file (see 7).
The command processing program (CPP) for the CRTCMDHLP command (see Figure 10) is CMD006CL (see Figure 8). The CPP starts by extracting, formatting and storing information obtained from your command source member through a REXX procedure, CMD006RX (see Figure 11). Input to this procedure is the command source member for your command; output is the CMD006PF physical file (see Figure 7).
I chose REXX to retrieve the information from the command source member because of the language's superb parsing and string-handling capabilities. Examine 11 to get an idea of the power and ease of use this language offers. You may not understand everything, but much of what it's doing is obvious.
I chose REXX to retrieve the information from the command source member because of the language's superb parsing and string-handling capabilities. Examine Figure 11 to get an idea of the power and ease of use this language offers. You may not understand everything, but much of what it's doing is obvious.
I would like to use REXX more often, but unfortunately it is interpreted and can't be compiled. Of course, this means it executes relatively slowly. Therefore, you don't want to use it in situations where it would be called a great number of times (e.g., for every record of a large file). However, the speed wasn't a deterrent here since the procedure is only processing a small number of command source records.
(For more information on REXX, see IBM's REXX manuals: Procedures Language 400/REXX Reference and Procedures Language 400/REXX Programmer's Guide. Also, look for a REXX primer article in an upcoming issue of MC.)
After the REXX procedure CMD006RX loads the file CMD006PF with indexed command information, RPG program CMD006RG (see 9) is called. This program merges the source member for the help panel group shell, CMDPGSHELL (12), with the command information from file CMD006PF to create the panel group source member customized for your command. As mentioned earlier, this source member is ready to be compiled except for the help text. All of the tedious work required to set up the help panel group source member for your command is already done.
After the REXX procedure CMD006RX loads the file CMD006PF with indexed command information, RPG program CMD006RG (see Figure 9) is called. This program merges the source member for the help panel group shell, CMDPGSHELL (Figure 12), with the command information from file CMD006PF to create the panel group source member customized for your command. As mentioned earlier, this source member is ready to be compiled except for the help text. All of the tedious work required to set up the help panel group source member for your command is already done.
No More Excuses
The amount of time and effort required to create command help may have left your commands "helpless." But now, with the CRTCMDHLP utility, there's no reason why you can't provide your users with powerful, online command help. Your users can use the commands you've written with confidence because they can easily discover the command's purpose and its parameter requirements.
If someone wants to find out what a command is all about, all he needs to do is press the Help or F1 key, just as he does with OS/400 commands. You might even consider creating commands for programs used by your programmers just for the purpose of documenting the function.
Editor's Note: Although we like to practice what we preach, space considerations prevent us from publishing the UIM help text for the CRTCMDHLP command. It will be available on MC-BBS.
Richard Shaler is a senior technical editor for Midrange Computing.
References Guide to Progamming Application and Help Displays (SC41-0011, CD-ROM QBKA7902). Procedures Language 400/REXX Programmer's Guide (SC24-5553, CD-ROM QBKA4B02). Procedures Language 400/REXX Reference (SC24-5552, CD-ROM QBKA4C02).
The Create Command Help Utility
Figure 1 UIM Help Text for the OS/400 CPYF Command
Copy File (CPYF) Type choices, press Enter. From file . . . . . . . . . . . Name Library . ................................................................ To file . . : From file (FROMFILE) - Help : Library . : : From member : Specifies the name and library of the database file or : To member or : device file that contains the records being copied. A : Replace or ad : database file can be a physical file or a logical file. A : Create file : device file can be a diskette file or a tape file. : Print format : : : The possible library values are: : : : : *LIBL : : The library list is used to locate the database file : : or device file. : : : : More... : : F2=Extended help F10=Move to top F11=InfoSeeker : F3=Exit F4= : F12=Cancel F20=Enlarge F24=More keys : F13=How to us : : :..............................................................:
The Create Command Help Utility
Figure 2 Basic Help Panel Group Structure
:pnlgrp. :help name='command'. Help Module for Command :ehelp. :help name='command/parameter A'. Help Module for Parameter A :ehelp. :help name='command/parameter B'. Help Module for Parameter B :ehelp. :epnlgrp.
The Create Command Help Utility
Figure 3 Illustration of Contextual Help Area for the TSTCM
Test Command (TSTCMD) Type choices, press Enter. Parameter A. . . . . . . . . . . *LIBL Name, generic*, *LIBL... A Parameter B. . . . . . . . . . . Name. B Bottom F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys
The Create Command Help Utility
Figure 4 Partial Listing of UIM Source Member Created by CR
Columns . . . : 1 71 Browse UIMWRKLIB/QPNLSRC SEU==> WRKJOBPG 0009.00 :PNLGRP. 0010.00 .****************************************************************** 0011.00 .* 0012.00 .* Primary help text for the command. 0013.00 .* 0014.00 .****************************************************************** 0015.00 :HELP NAME='WRKJOBS'. 0016.00 Work with Jobs - Help. 0017.00 :P. 0018.00 ======== INSERT COMMAND LEVEL HELP TEXT HERE ======== 0019.00 :EHELP. 0020.00 .******************************************************************* 0021.00 .* 0022.00 .* Help text for the command parameters. 0023.00 .* 0024.00 .****************************************************************** 0025.00 :HELP NAME='WRKJOBS/JOB'. 0026.00 Job name (JOB) - Help 0027.00 :XH3.Job name (JOB)- Help 0028.00 :P. 0029.00 ======== INSERT PARAMETER LEVEL HELP TEXT HERE ========
The Create Command Help Utility
Figure 5 The CRTCMDHLP Prompt
Create Command Help (CRTCMDHLP) Type choices, press Enter. File name . . . . . . . . . . . QCMDSRC Name Library . . . . . . . . . . . *LIBL Name, *LIBL Command member name . . . . . . Name Target file . . . . . . . . . . QPNLSRC Name Library . . . . . . . . . . . *LIBL Name, *LIBL Target panel group member name Name Bottom F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys
The Create Command Help Utility
Figure 6 CRTCMDHLP Utility Source Members and Corresponding
Source Member Source File CMD006PF QDDSSRC CMD006CL QCLSRC CMD006RG QRPGSRC CRTCMDHLP QCMDSRC CMD006RX QREXSRC CMDPGSHELL QPNLSRC
The Create Command Help Utility
Figure 7 CMD006PF Physical File
*============================================================ * To compile: * * CRTPF FILE(XXX/CMD006PF) SRCFILE(XXX/QDDSSRC) * *============================================================ A R CSREC A CSKEY 3 A CSF01 1 A CSKWD 10 A CSF02 1 A CSDTA 50 A K CSKEY
The Create Command Help Utility
Figure 8 CMD006CL CL Program
/*===============================================================*/ /* To compile: */ /* */ /* CRTCLPGM PGM(XXX/CMD006CL) SRCFILE(XXX/QCLSRC) */ /* */ /*===============================================================*/ CMD006CL: + PGM PARM(&QFILE &CMDMBR &QTGTFILE &TGTMBR) DCL VAR(&QFILE) TYPE(*CHAR) LEN(20) DCL VAR(&QTGTFILE) TYPE(*CHAR) LEN(20) DCL VAR(&CMDMBR) TYPE(*CHAR) LEN(10) DCL VAR(&LIB) TYPE(*CHAR) LEN(10) DCL VAR(&FILE) TYPE(*CHAR) LEN(10) DCL VAR(&TGTLIB) TYPE(*CHAR) LEN(10) DCL VAR(&TGTFILE) TYPE(*CHAR) LEN(10) DCL VAR(&TGTMBR) TYPE(*CHAR) LEN(10) DCL VAR(&PARMS) TYPE(*CHAR) LEN(80) DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(80) DCL VAR(&MSGF) TYPE(*CHAR) LEN(10) DCL VAR(&MSGFLIB) TYPE(*CHAR) LEN(10) MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR)) CHGVAR VAR(&FILE) VALUE(%SST(&QFILE 1 10)) CHGVAR VAR(&LIB) VALUE(%SST(&QFILE 11 10)) CHKOBJ OBJ(&LIB/&FILE) OBJTYPE(*FILE) MBR(&CMDMBR) CHGVAR VAR(&TGTFILE) VALUE(%SST(&QTGTFILE 1 10)) CHGVAR VAR(&TGTLIB) VALUE(%SST(&QTGTFILE 11 10)) CHKOBJ OBJ(&TGTLIB/&TGTFILE) OBJTYPE(*FILE) CHKOBJ OBJ(&TGTLIB/&TGTFILE) OBJTYPE(*FILE) MBR(&TGTMBR) MONMSG MSGID(CPF9815) EXEC(GOTO CMDLBL(CONTINUE)) SNDPGMMSG MSGID(CPF5812) MSGF(QCPFMSG) MSGDTA(&TGTMBR *CAT + &TGTFILE *CAT &TGTLIB) MSGTYPE(*ESCAPE) CONTINUE: + CHGVAR VAR(&PARMS) VALUE(&LIB *BCAT &FILE *BCAT &CMDMBR) STRREXPRC SRCMBR(CMD006RX) SRCFILE(QREXSRC) PARM(&PARMS) OVRDBF FILE(SHELL) TOFILE(QPNLSRC) MBR(CMDPGSHELL) DLTF FILE(QTEMP/PNLGRP) MONMSG MSGID(CPF0000) CRTPF FILE(QTEMP/PNLGRP) RCDLEN(80) CALL PGM(CMD006RG) PARM(&TGTMBR &CMDMBR) CPYF FROMFILE(QTEMP/PNLGRP) TOFILE(&TGTLIB/&TGTFILE) + TOMBR(&TGTMBR) MBROPT(*REPLACE) FMTOPT(*CVTSRC) CHGPFM FILE(&TGTLIB/&TGTFILE) MBR(&TGTMBR) SRCTYPE(PNLGRP) SNDPGMMSG MSGID(CPC7305) MSGF(QCPFMSG) MSGDTA(&TGTMBR *CAT + &TGTFILE *CAT &TGTLIB) MSGTYPE(*COMP) GOTO CMDLBL(ENDPGM) ERROR: + RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) MSGF(&MSGF) + MSGFLIB(&MSGFLIB) SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) MSGDTA(&MSGDTA) + MSGTYPE(*ESCAPE) ENDPGM: + ENDPGM
The Create Command Help Utility
Figure 9 CMD006RG RPG Program
*============================================================ * To compile: * * CRTRPGPGM PGM(XXX/CMD006RG) SRCFILE(XXX/QRPGSRC) * *============================================================ *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+.. FCMD006PFIF E K DISK FSHELL IF F 92 DISK FPNLGRP O F 80 DISK E ARR 6 80 E ARC 1 2 80 ISHELL NS I 13 92 SHLDTA I '.* Panel G' C HLPPGN I '.* Used ' C HLPCMD I ':HELP NAME=' C HLPNAM I ' - Help ' C HLPHT I ':XH3. ' C HLPXH3 I ':P. ' C HLPPGH I ':EPNLGRP. ' C HLPEPG I DS I I '''' 1 1 QUOTE I I '1' 2 2 TRUE I I '1' 3 3 FSTNM C *ENTRY PLIST C PARM PGNAM 10 C PARM CMDNAM 10 C 1 DOWEQ1 C READ SHELL 99 C *IN99 IFEQ *ON C LEAVE C END C MOVELSHLDTA OUTBUF 80 C SAVNXC IFEQ TRUE C X ANDLT6 C ADD 1 X 30 C MOVELSHLDTA ARR,X C ITER C ENDIF C MOVELSHLDTA SRC11 11 C SELEC C SRC11 WHEQ HLPPGN C CAT PGNAM:2 OUTBUF C SRC11 WHEQ HLPCMD C CAT CMDNAM:1 OUTBUF C SRC11 WHEQ HLPNAM C FSTNM IFEQ TRUE C MOVE '0' FSTNM C EXSR APNNAM C ELSE C ADD 1 X C MOVELSHLDTA ARR,X C MOVE TRUE SAVNXC 1 C 'KWD' SETLLCMD006PF C ITER C ENDIF C SRC11 WHEQ HLPHT C EXSR APNHT C SRC11 WHEQ HLPXH3 C EXSR APNXHT C SRC11 WHEQ HLPPGH C MOVELSHLDTA OUTBUF C EXCPTWRTPG C MOVELARC,1 OUTBUF C SRC11 WHEQ HLPEPG C MOVELSHLDTA SAVDTA 80 C EXSR PRCAP C MOVELSAVDTA OUTBUF C ENDSL C EXCPTWRTPG C ENDDO C MOVE *ON *INLR *================================================================ C APNHT BEGSR C 'HDR' CHAINCMD006PF 99 C *IN99 IFEQ *OFF C CSDTA CAT SHLDTA:0 OUTBUF P C ENDIF C ENDSR *================================================================ C APNNAM BEGSR C 'CMD' CHAINCMD006PF 99 C *IN99 IFEQ *OFF C MOVELCSDTA MHNAM 10 C SHLDTA CAT CSDTA:0 OUTBUF P C CAT QUOTE:0 OUTBUF C CAT '.':0 OUTBUF C ENDIF C ENDSR *================================================================ C APNKWD BEGSR C SHLDTA CAT MHNAM:0 OUTBUF P C CAT '/':0 OUTBUF C CAT CSKWD:0 OUTBUF C CAT QUOTE:0 OUTBUF C CAT '.':0 OUTBUF C ENDSR *================================================================ C APNXHT BEGSR C SHLDTA CAT CSDTA:0 OUTBUF P C CAT '(':1 OUTBUF C CAT CSKWD:0 OUTBUF C CAT ')':0 OUTBUF C ENDSR *================================================================ C APNPHT BEGSR C CSDTA CAT '(':1 OUTBUF P C CAT CSKWD:0 OUTBUF C CAT ')':0 OUTBUF C CAT SHLDTA:0 OUTBUF C ENDSR *================================================================ C PRCAP BEGSR C 1 DOWEQ1 C READ CMD006PF 99 C *IN99 IFEQ *ON C LEAVE C ENDIF C 1 DO 6 Y 30 C SELEC C Y WHEQ 1 C MOVELARR,Y SHLDTA C EXSR APNKWD C EXCPTWRTPG C Y WHEQ 2 C MOVELARR,Y SHLDTA C EXSR APNPHT C EXCPTWRTPG C Y WHEQ 3 C MOVELARR,Y SHLDTA C EXSR APNXHT C EXCPTWRTPG C Y WHEQ 4 C MOVELARR,Y OUTBUF C EXCPTWRTPG C MOVELARC,2 OUTBUF P C EXCPTWRTPG C Y WHGT 4 C MOVELARR,Y OUTBUF C EXCPTWRTPG C ENDSL C ENDDO C ENDDO C ENDSR *================================================================ OPNLGRP E WRTPG O OUTBUF 80 *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+.. ** ======== INSERT COMMAND LEVEL HELP TEXT HERE ======== ======== INSERT PARAMETER LEVEL HELP TEXT HERE ========
The Create Command Help Utility
Figure 10 CRTCMDHLP Command
/*===============================================================*/ /* To compile: */ /* */ /* CRTCMD CMD(XXX/CRTCMDHLP) PGM(XXX/CMD006CL) + */ /* SRCFILE(XXX/QCMDSRC) */ /* */ /*===============================================================*/ CMD PROMPT('Create Command Help') PARM KWD(FILE) TYPE(Q1) PROMPT('File name') Q1: QUAL TYPE(*NAME) LEN(10) DFT(QCMDSRC) QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) + SPCVAL((*LIBL)) PROMPT('Library') PARM KWD(MBR) TYPE(*NAME) PROMPT('Command member + name') PARM KWD(TGTFILE) TYPE(Q2) PROMPT('Target file') Q2: QUAL TYPE(*NAME) LEN(10) DFT(QPNLSRC) QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) + SPCVAL((*LIBL)) PROMPT('Library') PARM KWD(TGTMBR) TYPE(*NAME) PROMPT('Target panel + group member name')
The Create Command Help Utility
Figure 11 CMD006RX REXX Procedure
parse arg lib file mbr libfile = lib || '/' || file 'CLRPFM CMD006PF' ovrstdi = 'OVRDBF FILE(STDIN) TOFILE(' ovrstdi = ovrstdi || libfile || ')' || ' MBR(' || mbr || ')' ovrstdi 'OVRDBF FILE(STDOUT) TOFILE(CMD006PF)' quote = '''' blank10 = ' ' say 'CMD' blank10 mbr do forever parse pull statement if statement = '' then leave if pos(' CMD ', statement) > 0 &, pos('PROMPT(', statement) > 0 then do parse var statement str1 '(' val ')' parse var val str1 (quote) parmval (quote) say 'HDR' blank10 parmval end else if pos(' PARM ' , statement) > 0 then do pmtval = '' do forever if pos('KWD(', statement) > 0 then do parse var statement str1 '(' kwdval ')' end if pos('PROMPT(', statement) > 0 then do parse var statement str1 'PROMPT(' val ')' parse var val str1 (quote) pmtval (quote) if right(strip(pmtval,'T'),1) = '+' then do pmtval = strip(pmtval,'T') pmtval = strip(pmtval,'T','+') parse pull statement str1 (quote) pmtval = pmtval || strip(str1,'L') end end if right(strip(statement, 't'),1) = '+' then parse pull statement else leave end len = length(kwdval) kwdval = substr(kwdval,1,len+(10-len)) say 'KWD' kwdval pmtval end end 'DLTOVR FILE(STDIN)' 'DLTOVR FILE(STDOUT)' return
The Create Command Help Utility
Figure 12 UIM Source Member Shell, CMDPGSHELL
.****************************************************************** .* .* Panel Group: .* .* Function: .* Used as the help text for command .* .****************************************************************** :PNLGRP. .****************************************************************** .* .* Primary help text for the command. .* .****************************************************************** :HELP NAME=' - Help :P. :EHELP. .******************************************************************* .* .* Help text for the command parameters. .* .****************************************************************** :HELP NAME=' - Help :XH3. :P. :EHELP. .****************************************************************** :EPNLGRP.
The Create Command Help Utility
Figure 13 Help Text for CRTCMDHLP
.****************************************************************** .* .* Panel Group: CMD006PG .* .* Function: .* Used as the help text for command CRTCMDHLP .* .****************************************************************** :PNLGRP. .****************************************************************** .* .* Primary help text for the command. .* .****************************************************************** :HELP NAME='CRTCMDHLP'. Create Command Help - Help :P. The Create Command Help (CRTCMDHLP) creates a panel group (PNLGRP) source member from the source code for a command definition. :EHELP. .******************************************************************* .* .* Help text for the command parameters. .* .****************************************************************** :HELP NAME='CRTCMDHLP/FILE'. File name (FILE) - Help :XH3.File name (FILE) :P. Enter the name of the file and library where the source code for the command definition exists. :EHELP. .****************************************************************** :HELP NAME='CRTCMDHLP/MBR'. Command member name (MBR) - Help :XH3.Command member name (MBR) :P. Enter the name of the member where the source code for the command definition exists. :EHELP. .****************************************************************** :HELP NAME='CRTCMDHLP/TGTFILE'. Target file (TGTFILE) - Help :XH3.Target file (TGTFILE) :P. Enter the name of the file and library where you want the source code for the panel group to be placed. :EHELP. .****************************************************************** :HELP NAME='CRTCMDHLP/TGTMBR'. Target panel group member name (TGTMBR) - Help :XH3.Target panel group member name (TGTMBR) :P. Enter the name of the member where you want the source code for the panel group to be placed. :EHELP. .****************************************************************** :EPNLGRP.
LATEST COMMENTS
MC Press Online