Executing Commands during SEU

Execute commands (or programs) using the technique outlined below Whenever a command is entered into SEU under type CLP, the command's validity checking program (if it has one) will execute. Imagine what would happen if the validity checker was QCMD! In fact the validiy checking program can execute anything as long as the program's parameters match the commands parameters. In the example below the command "@" has a validity checking program of "QCMD" and a command processing program called "RETURN" which just has the RETURN statement in it.





QCMDSRC for source @
*************** Beginning of data *************************************
0001.00 CMD
****************** End of data ****************************************




QCLSRC for source RETURN
*************** Beginning of data *************************************
0001.00 RETURN
****************** End of data ****************************************


Create the command as follows:



Create Command (CRTCMD) 

Command . . . . . . . . . . . .. . .>_@_________ Name
Library . . . . . . . . . . . . . .  _*CURLIB____ Name, *CURLIB
Program to process command . . .  . >_RETURN_____ Name, *REXX
Library . . . . . . . . . . . .. . . _*LIBL______ Name, *LIBL, *CURLIB
Source file . . . . . . . . . .. . . _QCMDSRC____ Name
Library . . . . . . . . . .. . . .  ._*LIBL______ Name, *LIBL, *CURLIB
Source member . . . . . . . . . . . >_CMD________ Name, *CMD
Text 'description' .  . . . . . . . ._*SRCMBRTXT____________________


                                 Additional Parameters

Validity checking program . . . >_QCMD_______ Name, *NONE
Library . . . . . . . . . . . . > _QSYS_______ Name, *LIBL, *CURLIB




    

When you have entered and compiled the source code above, edit any CLP source member and enter "@"on any blank line and low and behold QCMD will execute. To return to SEU simple press CMD-3. Another example would be to write a CLP program called WAJ (say) that executes the WRKACTJOB)command. In the create-command above, change "@" to WAJ in the command parameter and from QCMD to WAJ for the Validity Checker parameter. When you type WAJ on any blank line in a CLP source member, the WRKACTJOB command will execute.


Home | Software Solutions | iSeries Security | Tips & Techniques | Consulting | About us | Contact Us



Sentinex Inc.
379 Hamilton Drive
Stewartsville, NJ, 08886

Telephone: (800) 822 1004
Outside USA: (908) 213 8650
FAX: (908) 213 8652
e-Mail: info@sentinex.com
Member of PartnerWorld for Developers
IBM is a registered trademark of IBM Corporation.