Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 10 Processing VSAM Data Using TIBCO Object Service Broker : Sample Rules

Sample Rules
Sample Rule 1: Accessing Multiple Record Formats
If the file contains multiple record formats in one physical record, you can access all the records in the file by using rules statements similar to those that follow. To update a record, you must update the base table after updating the other multiple record format tables. The tables in this rule are the ones defined in Sample Definition (Record A) and Sample Definition (Record B).

 
RULE EDITOR ===> SCROLL: P
VSAMREPEAT(NEW_NAME);
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ FORALL EMPLOYEE_VSAM_A : | 1
_ FORALL EMPLOYEE_VSAM_B(EMPLOYEE_VSAM_A.KEY) : |
_ EMPLOYEE_VSAM_B.LNAME = NEW_NAME; |
_ EMPLOYEE_VSAM_B.FNAME = EMPLOYEE_VSAM_B.FNAME || |
_ ’ STUDENT’; |
_ REPLACE EMPLOYEE_VSAM_B(EMPLOYEE_VSAM_A.KEY); |
_ END; |
_ REPLACE EMPLOYEE_VSAM_A; |
_ END; |
_ ---------------------------------------------------------------------------







PFKEYS: 1=HELP 3=END 12=CANCEL 13=PRINT 14=EXPAND 2=DOCUMENT 22=DELETE

 
Sample Rule 2: Inserting Parent Record with Children
The following is a sample rule illustrating how to insert a parent record with children.
When the physical record is written as indicated by INSERT EMPLOYEE_A; the record must be full.
The tables in this rule are the ones defined in Sample Definition (Record A) and Sample Definition (Record B) except the data set type is ESDS instead of KSDS.

 
RULE EDITOR ===> SCROLL: P
INSERT_VSAM;
_
_ ---------------------------------------------------------------------------
_ ------------------------------------------------------------+--------------
_ EMPLOYEE_A.KEY = 1; | 2
_ EMPLOYEE_A.DEPTNO = 10; | 3
_ EMPLOYEE_B.LNAME = ’DOE’; | 4
_ EMPLOYEE_B.FNAME = ’JOHN’; | 5
_ INSERT EMPLOYEE_B(EMPLOYEE_A.KEY); | 6
_ EMPLOYEE_B.LNAME = ’ANN’; | 7
_ EMPLOYEE_B.FNAME = ’MARY’; | 8
_ INSERT EMPLOYEE_B(EMPLOYEE_A.KEY); | 9
_ EMPLOYEE_B.LNAME = ’DICK’; | A
_ EMPLOYEE_B.FNAME = ’TRACY’; | B
_ INSERT EMPLOYEE_B(EMPLOYEE_A.KEY); | C
_ INSERT EMPLOYEE_A; | D
_ ---------------------------------------------------------------------------




PFKEYS: 1=HELP 3=END 12=CANCEL 13=PRINT 14=EXPAND 2=DOCUMENT 22=DELETE

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved