Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 4 Processing IMS Data : Using Rules

Using Rules
Accessing IMS data using the TIBCO Object Service Broker rules language is similar to accessing TIBCO Object Service Broker data. The main difference is in the way IMS uses your selection criteria in conjunction with the IMS table definition to interpret the request.
The following sections outline any differences encountered while using rules, point out normal rules behavior that must be considered when building applications, and explain how your rules selection criteria translates into DL/I calls.
Transaction Processing
If you issue a rule language EXECUTE statement within a main (parent) transaction, it creates another transaction stream (child transaction), to a maximum of ten streams. The number of streams allowed in a TIBCO Object Service Broker transaction depends on the TRANMAXNUM Execution Environment parameter, which has a default of nine streams. Each transaction stream in TIBCO Object Service Broker accessing IMS data requires its own TIBCO Service Gateway for IMS/DB or TIBCO Service Gateway for IMS/DB under CICS DL/I task.
Ensure your system administrator is aware of the number of TIBCO Service Gateway for IMS/DB or TIBCO Service Gateway for IMS/DB under CICS DL/I tasks required to accommodate all transaction streams accessing IMS data in a single transaction.
POOLSIZE and CTABLESIZE Parameters
The number of IMS tables you can access per transaction depends on the POOLSIZE gateway parameter, and the CTABLESIZE Data Object Broker parameter. If the default parameter sizes are used, you can access at least 16 IMS tables per transaction; more, depending on the size of the IMS table definitions. Refer to Estimating the CTABLESIZE Parameter for more information. Refer to TIBCO Object Service Broker Parameters for more information about parameters.
TRANSFERCALL and Data Object Broker DISPLAY & TRANSFERCALL Statements
Using TRANSFERCALL or DISPLAY & TRANSFERCALL statements in a rule minimizes the number of Gateways and reduces the possibility of IMS locking contention.
THREADUSAGE Parameters
If your TIBCO Service Gateway for IMS/DB is executing in a CICS Execution Environment, when the THREADUSAGE gateway startup parameter is set to TRANSACTION or TABLE, the PSB specified by the first IMS table accessed in a TIBCO Object Service Broker transaction is scheduled for the duration of that transaction.
If your TIBCO Object Service Broker transaction requests access to IMS data using more than one IMS table definition, the following occurs:
If THREADUSAGE=TRANSACTION, the PSB scheduled at the start of a transaction is assumed to be valid for all subsequent access requests. If a subsequent IMS table specifies a different PSB, it is ignored.
If THREADUSAGE=TABLE, the PSB scheduled at the start of a transaction is still valid for all subsequent access requests. However, the PSB specified by subsequent IMS table definitions must be the same as the scheduled PSB or the subsequent definitions must not specify a PSB. If a different PSB is encountered, the transaction fails.
Retrieval Processing
The Gateway uses PATH calls to access IMS data. Only one PATH call is required for each GET or FORALL in your rule that is retrieving a sequence of segments in a hierarchical path. An occurrence is returned only if data is available for all segments defined in the path.
The Gateway includes all parameter values and access values in the SSA with an equality qualification. Additionally, the Gateway uses the selection criteria specified for primary keys and for IMS fields that are defined in the DBD, providing the selection criteria meets all the following conditions:
For HDAM databases only, an equality operator is specified for a primary key. HDAM databases use a random storage method, therefore, if another operator is specified, the Gateway does the following:
For GET processing, it reads all segment occurrences in the access path, until it finds the first occurrence satisfying the selection criteria.
For FORALL processing, it reads all segment occurrences in the access path to find all occurrences satisfying the selection criteria.
Use of the the disjunctive logical operator "OR" ("|") or the "NOT" ("¬") logical operator will result in a sweep of the IMS data without field qualification via an IMS Segment Search Argument (SSA).
When a TIBCO Object Service Broker transaction runs in browse mode, locks are not taken on the TIBCO Object Service Broker data. Locking of IMS data is determined by the PROCOPT parameter for the database PCB in the Gateway PSB. Refer to Defining Gateway Program Specification Blocks for more information.
GET Statement
A GET statement retrieves the first occurrence in the IMS table satisfying the specified selection criteria.
A GET…ORDERED statement retrieves all IMS data satisfying the selection criteria, and sorts it in the Execution Environment before returning the first occurrence.
FORALL Statement
A FORALL statement is a looping construct that processes a set of occurrences. The body of the loop consists of the statements to be executed for each occurrence satisfying the selection criteria. FORALL statements can be nested provided they refer to different table names.
A FORALL returns occurrences to TIBCO Object Service Broker in the order in which IMS passes them. To get the data in a different order, include an ORDERED clause in the FORALL. TIBCO Object Service Broker orders only occurrences specified in the selection criteria.
Retrieving Non-unique Segments
IMS tables containing non-unique segments (no key, or a multiple sequence key) require their own database PCB. This enables the Gateway to maintain its position in the IMS database when accessing non-unique IMS data.
Ensure that your IMS database administrator is aware of the maximum number of GET and FORALL statements that access non-unique IMS tables in a single TIBCO Object Service Broker transaction. The database administrator needs to know to which IMS database these tables map, to determine the number of database PCBs required for each database defined in the Gateway PSB. Refer to Chapter 2, Operating the Service Gateway for IMS/DB for more information.
Replace (Update) Processing
A REPLACE request against an IMS table modifies the last TIBCO Object Service Broker IMS occurrence retrieved. All segments defined in the access path are replaced, starting with the segment where the primary key is defined. Parameterized segments are used for positioning only.
Considerations
You can modify all fields selected from each segment defined in the access path, starting with the segment where the primary key is defined. Consider the following when modifying fields:
You cannot modify unique sequence key fields. IMS requires you to delete the segment occurrence and re-insert it into the database with the new key value. The consequences of modifying the value of a child segment’s sequence key (that was selected as a field of the IMS table definition) are described in the fourth point in Using the Table Browser and Table Editor.
All segments in the access path, starting with the segment where the primary key is defined, are fully defined to TIBCO Object Service Broker.
Insert Processing
An INSERT request to an IMS table inserts all segments defined in the access path, starting with the segment where the primary key is defined. Parameterized segments are used for positioning only.
All segments in the access path, starting with the segment where the primary key is defined, must have all fields defined to TIBCO Object Service Broker.
INSERTs into IMS tables with overlapping fields are not permitted.
Delete Processing
A DELETE request against an IMS table deletes either the last TIBCO Object Service Broker IMS occurrence retrieved or the occurrence that contains the primary key value specified in the DELETE request.
The segment the primary key is defined at and all child segments associated with that parent are deleted. Parameterized segments are used for positioning only.
You cannot delete occurrences from IMS tables containing non-unique segments unless Optimize Update=Y in the IMS table definition. Refer to Task D: Select an IMS Database for more information on Optimize Update.
See Also
TIBCO Object Service Broker Parameters about the TRANMAXNUM Execution Environment parameter.
TIBCO Object Service Broker Programming in Rules about rules language statements and coding.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved