The following steps describe how to develop and run an IMS Smalltalk application on the workstation.
To run the Micro Focus Workbench with the IMS Option from Smalltalk, do the following:
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.
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.
In Smalltalk, code your application. Use the Smalltalk classes that enable you to interact with IMS, as necessary.
Note: | Your application's DL/I calls are restricted to eleven SSAs on the workstation. |
See the following for more information:
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:
IMSSimulationSystem new.
(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.
The way you test the application depends on the type of IMS application you have written. There are two types of IMS applications:
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.
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. |