Previous Page Contents Page

4.2 Testing the Application

After examining the source code for the sample application, you may want to test it. The following steps are required:

  1. Ensure that you have access to a suitable host computer against which you can run the application

  2. Compile and link the application

  3. Configure SNAP-IX for use with LUA (this task will normally be performed by your System Administrator)

  4. Run the application

These steps are explained in more detail in the following sections.

4.2.1 Host Requirements

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.

4.2.2 Configuration for the Sample Application

SNAP-IX must be configured to include the required LU. This task is usually performed by the System Administrator. The following components are required:

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:

4.2.3 Compiling and Linking the Sample Application

To compile and link the program for a Solaris system, take the following steps.

  1. Copy the file lsample.c from the directory /opt/sna/samples to a private directory.

  2. 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.

4.2.4 Running the Sample Application

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:

  1. Ensure that the SNAP-IX software is started, and that the LS to the host is active; contact your System Administrator if necessary.

  2. Set the environment variable SNATBLG to the name of the file containing the Table G translation table. Include the full path of the file if it is not in the current directory.

  3. 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 active
    when it has successfully established a session to the host.

  4. Enter data as you would normally do to log on and access host applications.

  5. 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 session
    
    or
    SSCP session
    to indicate the session you are currently connected to. It also switches automatically when a BIND or UNBIND message is received.

  6. When you have finished with host applications, follow any steps you would normally take to end the applications and log off.

  7. To terminate the application, press the ] (right square bracket) key followed by Enter.

    The application will display the message

    Closedown
    followed by
    Terminated
    to indicate that it has ended the session with the host. There may also be a Read failed message, with return codes that indicate that an outstanding RUI_READ verb was canceled by the RUI_TERM verb.

Previous Page Contents Page Top of Page