Using AS/400 Manager › Designing Automation for AS/400 Manager › Writing Automation REXX Programs
Writing Automation REXX Programs
The sample automation REXX programs AS400VRY and AS400CKJ can be used as a guide to write your own REXX programs. The sample programs follow these REXX programming guidelines:
- Call the supplied REXX program AS400JMP first to:
- Find the automation session name of the current AS/400 system
- Bind the automation session (this prevents another REXX program from interfering with the session)
- Check the status of the AS/400 system automation session
- Perform error recovery (if necessary)
- Report errors in the AP Msg window
- If the RESULT variable returned from AS400JMP contains the word ERROR, communication with the AS/400 system you requested was disabled for some reason. In this situation, AS400JMP calls the UNBIND function, if necessary. Therefore, you need to issue an appropriate error message or take some other action appropriate to the failure of your intended action, and then terminate your REXX program.
- If the RESULT variable does not contain the word ERROR, it contains the name of the CA Automation Point session through which communications with the AS/400 system name you specified is being managed.
- Issue the commands to the AS/400 system automation session using the SESSCMD command processor with the CA Automation Point session name returned by AS400JMP.
- If the SESSCMD command processor returns a nonzero RC (return code), call the REXX program AS400SLR (session lost routine) to perform error actions.
- The last actions performed by your REXX program should be to return the AS/400 screen to the MAIN menu ready for the next communication, and to call the UNBIND function supplied by CA Automation Point to release control of the automation session from your REXX program.
Copyright © 2012 CA.
All rights reserved.
|
|