After you have defined the host application screens
and fields used by a 3270 server, use this procedure to create the
3270 server script. In addition to Normal scripts,
you may also require Exception Definition and Exception
Handler scripts to process exception conditions.
For information about the types of scripts, see About scripts.
If you plan to execute and debug your 3270 server scripts using
the Blueworx Voice Response virtual
host support described in the Blueworx Voice Response for AIX:
Designing and Managing State Table Applications information, there is no live host to determine the current 3270 screen.
To ensure that your scripts operate consistently in both real and
virtual modes, include the following statements:
- CHECK_SCREEN
- Whenever a screen is expected, use the CHECK_SCREEN statement
to retrieve the screen from the database. In real mode, this statement
checks whether the specified screen matches the current screen. In
virtual mode, it simulates access to the specified screen.
- SET_CURSOR
- To set the cursor position, use the SET_CURSOR statement, described
in SET_CURSOR. In real
mode, the initial cursor position is controlled by the host application.
In virtual mode, use SET_CURSOR to explicitly set the initial cursor
position on the first screen used by the script.
Note: Because of
host delays, which can vary considerably, and because the sequence
of screens can vary, you need to build some timing considerations
into your scripts, for example, if you are waiting for a screen to
arrive (with CheckScreen in a do-while loop). It is important always
to have safe exits from these time delays, either with in-line code,
or an exception script, to close the host session correctly after
failing to receive a correct response. This will help to avoid continuous
loops and unnecessary use of processor resources.
For an example, see Using the Statements menu.
To create a 3270 server script:
- From the Welcome window, click on Applications —> 3270
Servers
- Select the server: Click the 3270 server you want under Servers.
- If scripts for the selected 3270 server are not displayed, click View —> Scripts.
- Click Object —> New. The system displays
the 3270 Script window.
- Specify script properties and description: To specify the
script type, click Properties, then one
of the following:
- Click Properties —> Description.
Type a description and click OK.
- Add script language statements: Add the script
language statements that define the script in one of the following
ways:
- By importing script language statements (in ASCII format) from
a file in the AIX file system to Blueworx Voice Response. For
instructions, see Importing scripts.
- By clicking the required script language statements from the Statements menu.
For instructions, see Using the Statements menu.
- By typing the script language statements yourself.
Inserting a new statement
To insert a new statement
at a selected position, move the cursor to the statement that will
precede the added statement. To insert a statement as the first entry
in the script, move to the left of the first statement and press Enter to
open a new line.
- Validate and save the script: Click File —>
Validate & Save. If the script syntax is valid,
the Validated field displays Yes.
An application that includes this script will not execute unless this
field displays Yes.
- Save the completed script and confirm
the name.
- Close the 3270 Script window.
If
the script is invalid, the system displays a message, prompting you
to cancel the operation or to save the script as is. The 3270 Servers
window displays the new script under Scripts.