In this section, a program called ESLLOGON is created. The program makes multiple calls to a single program as part of the same logical unit of work (LUW). For a detailed description of a logical unit of work, refer to Transaction Processing: Concepts and Products (GC33-0754). The concept of LUW in CICS is similar to the concept of transaction in many other systems; refer to CICS OS/2 System and Application Guide Version 1.20, (SC33-0616).
These calls could have easily been sent to different programs. Assume that variables exist that contain the user ID, password, and a record that contains the data to be sent. For simplicity, the same record is sent each time.
Create a transaction (logical unit of work) object by running the following code:
transaction:=AbtCICSLuw new
To run multiple programs as part of the same LUW, use the begin method as follows:
transaction begin
If the begin method is not sent to a transaction, it is assumed that a single program comprises the logical unit of work.
Create a program object to run during this LUW with the following expression:
program:= AbtCICSProgram named: 'ESLLOGON'
This program object can correspond to a COBOL or C program in CICS OS/2.
Pass a user ID and password with each program to allow access to that program. To allow access to the program, run the following code:
program login: userid password: password
Run the program and store any errors in the result variable. The record specified by aRecord is placed in the commArea of the program, and then the program is run. The commArea is returned when the program ends normally. Thus, results will contain either an error or a record.
result:= program executeAsPartOfTransaction: transaction withCommArea: aRecord
Check result to be sure that there are no errors.
result is CommunicationsError if true:[result display].
If an error was encountered, a debug window containing the error will pop up.
Either send a commit or rollback method to the transaction by sending one of the following messages:
transaction commit transaction rollback
A commit applies all of the changes made by the program(s), while a
rollback wipes them out from the beginning.
In AIX , VisualAge Smalltalk supports both the CICS Universal Client
and the CICS Client Version 2.0. The CICS Client Version
2.0 is set as the default. To change support between the two
versions, execute the following from the Smalltalk Transcript window:
Using CICS in AIX
AbtCICSBaseSmalltalkAIXSubapp selectUniversalClient
AbtCICSBaseSmalltalkAIXSubapp selectCICSClientV20