About scripts

Scripts replicate the actions of a 3270 terminal operator by using the defined fields on captured screens to send and receive information between a 3270 host application and the calling state table. Each action in a script is performed by one of the script language statements described in 3270 script language statements. A script can contain up to 65 536 characters.

You can use variables in the scripts: there is a size limit of 256 bytes per variable.

A 3270 server may consist of one or more scripts, depending on the complexity of the required host interaction. A script can be defined as a normal script, an exception definition script, or an exception handler script.

In addition, a 3270 server may include an initial script and a refresh script. These are normal scripts that perform session control.

Normal script

A normal script is a standard 3270 server script used for main processing. Normal scripts can pass parameters between the state table and the 3270 host application.

Exception definition and exception handler scripts

An exception definition script describes an exception condition. An exception handler script handles an exception condition. For example, exception conditions that can occur during the execution of a script include an unrecognized 3270 screen, unexpected messages, or application-specific conditions. Use an EXCEPTION script language statement to specify the exception definition and handler scripts for a particular exception condition. An EXCEPTION statement is active for the duration of a script, continuously checking for the specified condition in the background while the main script is processing. The EXCEPTION statement is described in EXCEPTION.

Initial script

You can write an initial script to perform necessary initialization processes. Typically, an initial script logs on to the 3270 host application and leaves it ready to process instructions from a Blueworx Voice Response application.

The initial script is run when one of the following happens:

If the initial script cannot log on to the host application, perhaps because it is not running, use the ABORT script statement to terminate it. This causes the session to be disabled, but the system will attempt to re-enable it, and the logon may be successful later. (If you terminate it using the DISABLE_SESSION script statement, the session is disabled and there are no attempts to re-enable it.)

Refresh script

A refresh script is periodically invoked at intervals that you specify when you define a 3270 server. Typically, a refresh script is used to perform a specified action to prevent an inactivity time-out. For example, if a system times out when there is no host activity, a refresh script can press Enter at specified intervals to avoid the time-out.

A refresh script is also useful to check that the session is still in the correct state, for example, at the logon screen after a period of inactivity.

As with the initial script, if a refresh script is terminated using the ABORT script statement, the session can be automatically re-enabled, whereas, if it is terminated using the DISABLE_SESSION script statement, the session must be started again using the 3270 Server Manager window.