|
|
|
After examining the source code for the sample application, you may want to test it. The following steps are required:
Ensure that you have access to a suitable host computer against which you can run the application
Compile and link the application
Configure SNAP-IX for use with LUA (this task will normally be performed by your System Administrator)
Run the application
These steps are explained in more detail in the following sections.
To run the sample application, you will need an LU on the host computer. Because the sample application is emulating a 3270 display terminal, the LU must be configured at the host as a 3270 display LU (LU type 2) such as 3278 or 3279. The LU number assigned at the host must be used when configuring the LU on SNAP-IX.
SNAP-IX must be configured to include the required LU. This task is usually performed by the System Administrator. The following components are required:
A DLC, port, and LS
An LU of type 0-3, with an LU number which matches that of a suitable LU on the host
These components can be given any names you wish; the only information required by the application is the LU to be used for the session. This is passed to the application as a single command-line parameter (the LU name), or as two command-line parameters (the PU name and LU number). The following items also apply to LU configuration:
The LU number configured for this LU in the SNAP-IX configuration must match the LU number assigned at the host.
You can configure an LU pool for use with the application, containing one or more LUs. To access the pool, you can then supply either the name of the pool or the name of any LU within it; the first available LU from the pool will be used.
To compile and link the program for a Solaris system, take the following steps.
Copy the file lsample.c from the directory /opt/sna/samples to a private directory.
Follow the instructions in Compiling and Linking the LUA Application to compile and link the program. Add the command-line option to link with the CSV library in addition to the LUA library, because the program uses CSV functions in addition to LUA.
This section assumes you have compiled and linked the sample application as described in Compiling and Linking the Sample Application.
The sample application uses the CSV interface as well as LUA; it includes calls to the CSV CONVERT verb to translate user-supplied data from ASCII to EBCDIC before sending it to the host, and to translate data received from the host into ASCII before displaying it on the screen. This translation uses a user-defined translation table (Table G), which is stored in a file on the SNAP-IX computer. A suitable file, /opt/sna/samples/luatblg.dat, is supplied with the LUA sample application program source.
To run the sample application, follow these steps:
Ensure that the SNAP-IX software is started, and that the LS to the host is active; contact your System Administrator if necessary.
Set the environment variable
Start the application by entering one of the following commands:
lsample luname
lsample puname lunumber
In this example, luname is the name of the LU you configured for this application (or the name of the LU pool or any LU within it).
In this example, puname is the name of the PU that owns the required LU, and lunumber is the LU number (specified as a decimal number).
The application will display the message
LU activewhen it has successfully established a session to the host.
Enter data as you would normally do to log on and access host applications.
To switch between the LU session and the SSCP session, press the [ (left square bracket) key followed by Enter.
The application will display the message
LU sessionor
SSCP sessionto indicate the session you are currently connected to. It also switches automatically when a BIND or UNBIND message is received.
When you have finished with host applications, follow any steps you would normally take to end the applications and log off.
To terminate the application, press the ] (right square bracket) key followed by Enter.
The application will display the message
Closedownfollowed by
Terminatedto indicate that it has ended the session with the host. There may also be a
Read failedmessage, with return codes that indicate that an outstanding RUI_READ verb was canceled by the RUI_TERM verb.
|
|
|
|