Previous Topic: Starting Scripts From Menus

Next Topic: MCS Console Screen After the Sample Script Executes


Sample Script and Console Screen

The following session state script configures an MCS console session for use by CA Automation Point.

*------------------------------------------------------------------------------*
* FILENAME: MCS.SCR                                                            *
*                                                                              *
* USE:      This script configures an MCS console for control by Automation    *
*           Point by issuing 'K' (control) commands.  To execute RULES         *
*           against MCS console messages, and to send those messages to the    *
*           Automation Window, Automation Point requires the console to be in  *
*           non-delete mode, with time and job stamps.  Automation will not    *
*           commence until the console is in this mode.                        *
*                                                                              *
* UPDATED:  7-JUL-94                                                           *
*                                                                              *
* NOTES:    One characteristic of MCS consoles is that if you enter an invalid *
*           or out-of-sequence 'K' command, the console will not accept any    *
*           new commands until you enter the command correctly or press the    *
*           PA2 key to reset.                                                  *
*                                                                              *
*------------------------------------------------------------------------------*
ERROR=IGNORE               * If search fails, proceed to next search

*------------------------------------------------------------------------------*
* Put the console in non-delete mode, 20 lines/segment, etc.                   *
*                                                                              *
* Note! The number of lines per segment will vary from console to console.     *
*       Make sure that that the number used below matches your console.        *
*------------------------------------------------------------------------------*

SEARCH=(IEE151I)           * Delete request inconsistent
   KEY=(@y)
   WAIT=1

ENDSEARCH

*------------------------------------------------------------------------------*
* The following message appears on the status line of a healthy pre MVS/SP 4.1 *
* MCS console. If found, set the console characteristics for AP's use.         *
*                                                                              *
* IEE152I     ENTER     CANCEL     D C,K                                       *
* If we attempt to set it to roll more lines than it has, the status line is:  *
* IEE156I K INVALID OPERAND -20                                                *
*------------------------------------------------------------------------------*
SEARCH=(IEE152I)           * Look for 'IEE152I' - if found, reconfigure console
  KEY=(k s,del=n,seg=39,con=n,mform=(t,j)@E)
  WAIT=1                   * Wait 1 second for the command to be accepted
  SEARCH=(IEE156I)         * Look for 'IEE156I' - if found, try again
    KEY=(@y)               * (@y=PA2)
    WAIT=1                 * Wait 1 second for the command to be accepted
    KEY=(k s,del=n,seg=20,con=n,mform=(t,j)@E)
    WAIT=1                 * Wait 1 second for the command to be accepted
    SEARCH=(IEE156I)         * Look for 'IEE156I' - if found, try again
      KEY=(@y)               * (@y=PA2)
      WAIT=1                 * Wait 1 second for the command to be accepted
      KEY=(k s,del=n,seg=19,con=n,mform=(t,j)@E)
      WAIT=1                 * Wait 1 second for the command to be accepted
    ENDSEARCH                * End of commands to perform if 'IEE156I' is found
  ENDSEARCH                * End of commands to perform if 'IEE156I' is found
ENDSEARCH                  * End of commands to perform if 'IEE152I' is found
*------------------------------------------------------------------------------*
* If the IEE152I is still there, we want to delete the display area, if one is *
* defined, because display areas cause problems for rules processing.          *
*------------------------------------------------------------------------------*
SEARCH=(IEE152I)           * Look for 'IEE152I' - if found, reconfigure console

  KEY=(k e,d@E)            * Clear the display area (@E=ENTER)
  WAIT=1                   * Wait 1 second for the command to be accepted
*------------------------------------------------------------------------------*
* If the console didn't have a display area, the following error message       *
* will have been displayed in the console status line:                         *
*                                                                              *
* IEE151I DELETE REQUEST INCONSISTENT-NO DISPLAY ON SCREEN   ENTER    CANCEL   *
*                                                                              *
* Just in case that happened, send a PA2 using the mnemonic '@y'               *
*------------------------------------------------------------------------------*

  KEY=(@y)                 * (@y=PA2)
  WAIT=1                   * Wait 1 second for the command to be accepted
  KEY=(k a,none@E)         * Delete the area so we won't get more area displays
  WAIT=1                   * Wait 1 second for the command to be accepted

  KEY=(axc here@E)         * Tell CA-OPS/MVS that AP is active at this console
  WAIT=1                   * Wait 1 second for the command to be accepted

ENDSEARCH                  * End of commands to perform if 'IEE152I' is found
*------------------------------------------------------------------------------*
* The following message appears on the status line of a healthy MVS/SP 4.1 or  *
* above (including all z/OS versions) MCS console. If found, set the console *
* characteristics for AP's use.                                                *
*                                                                              *
* IEE612I CN=02       DEVNUM=60D  SYS=S032     CMDSYS=S032                     *
* If we attempt to set it to roll more lines than it has, the status line is:  *
* IEE156I K INVALID OPERAND -20                                                *
*------------------------------------------------------------------------------*
SEARCH=(IEE612I)           * Look for 'IEE612I' - if found, reconfigure console
  KEY=(k s,del=n,seg=39,con=n,mform=(t,j)@E)
  WAIT=1                   * Wait 1 second for the command to be accepted
  SEARCH=(IEE156I)         * Look for 'IEE156I' - if found, try again
    KEY=(@y)               * (@y=PA2)
    WAIT=1                 * Wait 1 second for the command to be accepted
    KEY=(k s,del=n,seg=20,con=n,mform=(t,j)@E)
    WAIT=1                 * Wait 1 second for the command to be accepted
    SEARCH=(IEE156I)         * Look for 'IEE156I' - if found, try again
      KEY=(@y)               * (@y=PA2)
      WAIT=1                 * Wait 1 second for the command to be accepted
      KEY=(k s,del=n,seg=19,con=n,mform=(t,j)@E)
      WAIT=1                 * Wait 1 second for the command to be accepted
    ENDSEARCH                * End of commands to perform if 'IEE156I' is found
  ENDSEARCH                * End of commands to perform if 'IEE156I' is found
ENDSEARCH                  * End of commands to perform if 'IEE612I' is found
*------------------------------------------------------------------------------*
* If the IEE612I is still there, we want to delete the display area, if one is *
* defined, because display areas cause problems for rules processing.          *
*------------------------------------------------------------------------------*
SEARCH=(IEE612I)           * Look for 'IEE612I' - if found, reconfigure console

  KEY=(k e,d@E)            * Clear the display area (@E=ENTER)
  WAIT=1                   * Wait 1 second for the command to be accepted
*------------------------------------------------------------------------------*
* If the console didn't have a display area, the following error message       *
* will have been displayed in the console status line:                         *
*                                                                              *
* IEE151I DELETE REQUEST INCONSISTENT-NO DISPLAY ON SCREEN   ENTER    CANCEL   *
*                                                                              *
* Just in case that happened, send a PA2 using the mnemonic '@y'               *
*------------------------------------------------------------------------------*

  KEY=(@y)                 * (@y=PA2)
  WAIT=1                   * Wait 1 second for the command to be accepted
  SEARCH=(IEE612I)
    KEY=(k a,none@E)         * Delete the area so we won't get more area displays
    WAIT=1                   * Wait 1 second for the command to be accepted

    SEARCH=(IEE612I)
     KEY=(axc here@E)         * Tell CA-OPS/MVS that AP is active at this console
     WAIT=1                   * Wait 1 second for the command to be accepted
    ENDSEARCH
  ENDSEARCH
ENDSEARCH                  * End of commands to perform if 'IEE612I' is found
*------------------------------------------------------------------------------*
* Search for error messages that the MCS console driver recognizes as          *
* bad modes and clear them.                                                    *
*------------------------------------------------------------------------------*

SEARCH=(IEE160I)           * UNVIEWABLE MESSAGE
   KEY=(k e,d)
   WAIT=1
ENDSEARCH

SEARCH=(IEE163I MODE= RD)
   KEY=(@y)
   WAIT=1
ENDSEARCH
SEARCH=(IEE163I MODE=)
   KEY=(@E)
   WAIT=1
ENDSEARCH

SEARCH=(IEE164I)
   KEY=(@y)
   WAIT=1
ENDSEARCH