Server Guide

Developing your IMS application on the workstation

The following steps describe how to develop and run an IMS Smalltalk application on the workstation.

Step 1: Starting Smalltalk and establishing the simulator environment

To run the Micro Focus Workbench with the IMS Option from Smalltalk, do the following:

  1. Edit the directory paths and environment variables.

    For OS/2, this is done in the abtvims.cmd which starts Smalltalk. The directory must be the directory where Micro Focus Workbench is installed. If you create a user directory to use with Micro Focus Workbench, change the MYDIR path. The abtvims.cmd file should look like the following:

    rem Smalltalk with IMS-simulator startup
    @ECHO OFF
    rem setup directory paths
    SET PLIWB=d:\MVSWB\pliwb
    SET PLIGUI=d:\MVSWB\pligui
    SET TSODIR=d:\ADMVS32
    SET MYDIR=e:\MVSWB\mydir
    rem setup environment variables
    SET COBHNF=%PLIWB%\RESLIB
    SET COBDIR=%PLIWB%\RESLIB;%TSODIR%\RESLIB;%TSODIR%\ISPF;
    %TSODIR%\PROX32;%PLIWB%\IMS32;%PLIWB%\SYSLMOD;
    %TSODIR%\SYSLMOD;%TSODIR%\32BIT370;%PLIWB%\IMSDEMO;
    %TSODIR%\SAMPJCL;%PLIWB%\ISPF;
    SET IMSDIR=%PLIWB%\IMS32
    SET IMSCFG=%PLIWB%\IMSDEMO
    SET IMSLIB=%PLIWB%\IMSDEMO
    rem SET IMSLIB=%MYDIR%\IMSLIB
    rem SET IMSLIB2=%PLIWB%\IMSDEMO
    SET IMSDAT=%PLIWB%\IMSDATA
    rem SET IMSDAT=%MYDIR%\IMSDATA
    SET IMSWRK=%PLIWB%\IMSDEMO
    START ABT
    

    For NT, the directory paths and environment variables are defined in the files mfwbenv.sys and imsenv.sys which are installed into the respective root directories of the Micro Focus Workbench and IMS option. If you create a user directory, you will need to modify these files. A sample startup file is included in the root VisualAge directory, abtvims.bat. This file needs to be used to start the Smalltalk environment with the simulator environment.

  2. Run abtvims.cmd to start Smalltalk under IMS.

Step 2: Creating the I/O area

A program uses an I/O area to pass segments back and forth between itself and IMS. What the I/O area contains depends on the kind of call you are issuing:

In Smalltalk, you can define the I/O area as a collection of ByteArrays or OSObjects with a reftype value of structure. To break the structure of the I/O area into usable Smalltalk classes, use either a COBOL or C parser. For information on COBOL or C parsers, refer to the VisualAge User's Guide.

See IMS/ESA Application Programming: DL/I Calls for more information about the I/O area.

Step 3: Coding your Smalltalk application

In Smalltalk, code your application. Use the Smalltalk classes that enable you to interact with IMS, as necessary.

IMSDBRequester
Enables you to modify accessible segments of a database using DL/I calls.

IMSServiceRequester
Enables you to obtain either database or transaction manager services using DL/I calls.

IMSTMRequester
Enables you to retrieve and send messages in the transaction manager using DL/I calls.
Note:Your application's DL/I calls are restricted to eleven SSAs on the workstation.

References

See the following for more information:

Step 4: Setting up the simulator from Smalltalk

To test your Smalltalk application with the Micro Focus Workbench simulator, you must create an instance of the IMSSimulationSystem class. See IMSSimulationSystem class for more information.

Two files are included as examples: abtvixmp.ws and abtvitst.ws. abtvixmp.ws contains examples of running the simulator; the code is not meant to run. abtvitst.ws contains examples you can run.

The following lines are included in abtvixmp.ws. Follow these steps to prepare the simulator for application testing:

  1. Create an IMSSimulationSystem object:
    IMSSimulationSystem new.
    
  2. Request no trace information (which is the default):
    (IMSSimulationSystem new) simulatorTrace: false.
    

abtvitst.ws contains a script that runs with trace true and shows successful trace output. If the simulator call fails, retry the request with the simulator trace active to get a trace of COBPARM and DDBAPARM, which are used by the simulator.

Step 5: Testing your Smalltalk application on the workstation

The way you test the application depends on the type of IMS application you have written. There are two types of IMS applications:

Testing an IMS batch application

To test a batch application on the workstation, use the class method from the IMSSimulationSystem class named runBatchStartUpCode:onPSB:. Provide the launch code for your application and the name of the PSB you are referencing as arguments to the instance of the simulator you have created:

(IMSSimulationSystem new) runBatchStartUpCode: 'IMSBankStatement
   new generateStatement' onPSB: 'PSBBANK1'.

Select this statement from the System Transcript or workspace and run it.

Testing an IMS online application

To test an application that can run in a message processing region on the workstation, use the class method from the IMSSimulationSystem class named runOnlineStartUpCode:onPSB:message:. Provide your launch code, the name of the PSB you are referencing, and the input message as arguments to the instance of the simulator you have created:

| temp |
 
temp := ByteArray new: 30.
temp := temp copyReplaceFrom: 1 to: 4 withObject: 0.
temp := temp copyReplaceFrom: 5 to: 30 with: 'CHECKCR 3333333333 1234.56'
(IMSSimulationSystem new) runOnlineStartUpCode: 'IMSBankTransactions
            new transaction' onPSB: 'PSBBANK4' message: (Array with: temp).

Select these statements from the System Transcript and run them.

Note:Test your IMS code through Micro Focus Workbench using the development image.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]