Shell processing - IBM - AS/400

This section contains a more detailed description of the user shell processes. Besides providing an overall understanding, this section could be useful in tracking down an error condition.

There are three major user shell control processes:

  • Shell initialization
  • Shell runtime processing
  • Shell shutdown

An unexpected return code during any of these processes causes message AEG1112 to be sent to the system operator, a dump to be taken, and a fatal error condition to be set.

Shell initialization
User application initialization builds the background environment common to all CICS sessions. This includes:

  • Verifying that the CICS control region is up and available
  • Invoking shell resource initialization routines
  • Establishing a protected environment to insulate CICS from application errors
  • Optionally, starting an initial transaction

In more detail, the initialization process consists of the following steps:

  1. CICS verifies that this shell’s user space does not exist. (If it exists, message AEG1114 is issued.)
  2. The shell task control area is initialized.
  3. The control region’s user space is located, and some system information from the control region’s area is copied into the shell’s user space area.
  4. Note: The shell’s user space acts as an anchor control block that allows the EXEC interface program (called by application programs) to reestablish addressability (by using pointers) to internal control blocks.
    You should note that by using the ENDSBS command rather than ENDCICS command, CICS is no longer in control of ending shell jobs. If there are active CICS shells when ENDSBS is issued, they may lose contact with the control region because the control region has ended or the control region may try to contact a shell job which no longer exists. The result is the extraneous message may be issued in this case due to this lost communication.
  5. An initialization and termination table, similar to the one used in the control region, is processed. For example, storage services are called first to set up user space areas. The return code passed back from each function is checked before proceeding with the initialization process. If errors occurred during shell initialization, message AEG1104 is issued (Initialization module_function _failed with return code _). A severity level of 20 or higher (message AEG1103 issued) causes shell initialization to cease.
  6. A data queue request is sent to change the shell’s dispatch control area (DCA) to a ready status.
  7. If initial data, or an initial TRANID, or both, were specified in STRCICSUSR, the terminal control facility is called to build the initial terminal input/output area (TIOA).
  8. If there was no initial TRANID, the message “CICS is ready for transactions” is sent to the terminal.

When all shell startup processes are complete, the terminal operator (if this is an interactive job) is sent a message indicating that the shell is initialized and operational. The CICS user can then enter transactions.

Runtime processing
After initialization, the shell coordinates the repetitive process of event scheduling, (ATI, IC START, ISC, or terminal input) scheduling and task termination with syncpoint and rollback processing.

Note: The shell can receive work from a data queue, display file, or ICF file.

The runtime processing of the shell can be described in the following steps:

  1. The shell checks for timer event controlled activity.
  2. The shell calls terminal control to accept input. This may be display file input, an intercommunication function, or a service request from the control region.
  3. If a CICS data queue message is returned, the internal CICS function is called.
  4. If a terminal input/output area (TIOA) is returned, CICS:
    • Determines a transaction id.
    • Ensures that the transaction is valid (that is, matches a PCT entry) and available.
    • Initializes the EIB.
    • Links to the application program.
    • – If this is the first call, addressability to control blocks is established.
      – If a transaction work area was specified, this area is allocated from nonshared GETMAIN storage.
    • If no syncpoint was requested by the program, the contents of the EIBRESP field of the EXEC interface block are tested. If EIBRESP is blank, the task has ended normally and CICS will perform a default syncpoint commit.If EIBRESP contains a return code, an abend has occurred and CICS will perform a rollback. If an application transaction abends, message AEG1111 is sent to the user indicating that the transaction abended.
    • Performs a scan of task termination deferred work elements(DWEs) for work ready to process.
  5. The shell checks whether CICS is in shutdown mode. If not, processing is repeated until shutdown is indicated.

Shell shutdown
Shutdown processing can be initiated by any of the following:

  • Terminal input (CESF transaction).
  • A single-shot transaction being specified. That is, an initial transaction was entered for the TRANID parameter on the STRCICSUSR command.
  • Completion of the ATI or IC START work (nonterminal shells).
  • ISC link shutdown.
  • CICS control region shutdown requests.
  • User shell shutdown requests (ENDJOB, ENDSBS, or ENDSYS CL commands).

Note: A shell will respond to an external end request, such as a message sent by the control region during shutdown processing, only when it next returns to a dequeue state. If the shell is processing a conversational task or is running in a held OS/400 job, shutdown will not occur immediately.

Shutdown provides for a reversal of the initialization process. A controlled shell shutdown consists of the following steps:

  1. The terminal user (if any) is notified that shell shutdown has commenced.
  2. A data queue message is sent to the control region to change the status to indicate that shutdown has begun.
  3. The shell’s control region user space is deleted.
  4. In a similar manner to initialization, the termination modules list is processed to release resources and clean up the environment. The return code is checked after each module. If a severity of 20 or higher is returned (message AEG1109), the shutdown process is abandoned.
  5. The control region is notified that the shell has completed the shutdown process.

If you want the terminal shell to shut down when either the terminal is switched off or the session is ended, the job description for the job running in the terminal shell should have the device recovery action (DEVRCYACN) parameter set to *ENDJOB. Some directly-connected terminals do not require this parameter to be set, but setting it does not change the shell execution. If the shell is to be run in a passthru session, the DEVRCYACN parameter must be set in the job description for the job that issues the STRPASTHR command.

If CESF LOGOFF (supplied transaction) is used,the shell logs the user off from CICS and issues the OS/400 SIGNOFF CL command.

If termination is caused by a CICS shutdown, the user is informed of the involuntary shutdown.Control is returned to OS/400 facilities.

Nonterminal users are shut down by internal data queue commands or ISC conversation link termination.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

IBM - AS/400 Topics