The routine is only useable in Easytrieve Plus. There are two include members, and one DD statement is required in the JCL.
Include #1
The first include member is SI0900A. It contains
the working storage fields and DB2 Declares necessary for the routines
to work. It should be the last entry in your Files
section (the last entry before your first Job
statement).
This include uses an Easytrieve Plus Macro variable. This Macro variable is named SISVER and must be a Macro variable in the original program.
Include #2
This Include is named SI0900B. It does the actual
work to determine if the batch header you are creating is unique. It
takes two arguments:
The SI0900B Include is invoked as follows:
where xxx is the variable containing the 6 character batch identifier and yyy is the variable containing the batch date.
Once this is done, it continues and looks and the SCT SIS file where previously processed batches are stored and performs the same process as described above.
Once these two processes are complete, the routine returns the batch identifier and batch date. The batch date will always be identical to what you specified. The batch identifier returned is what your program should use to insure it is unique.
//SISTRN DD DSN=xxx,DISP=SHR
where xxx is the dataset name(s) of the file(s) containing batch transactions waiting for processing. This file(s) is not updated in any way, but is opened and read several times. It must be present in your JCL.
MACRO SISVER FILE FILE01 WBATCHID W 006 A VALUE 'CNV001' WBATCHDATE W 008 A VALUE '11241997' %SI0900A &SISVER JOB INPUT NULL %SI0900B WBATCHID WBATCHDATE DISPLAY 'BATCH ID=' WBATCHID DISPLAY 'BATCH DATE=' WBATCHDATE STOP
This is a very simplistic example of use of the SI0900B routine. It will determine whether CNV001 is a unique batch identifier for 11/24/1997. If not, it will determine an appropriate batch identifier (WBATCHID) for the 11/24/1997 date that will make it unique. When run with test data on 02/04/1998, the batch identifier returned was CNV005.
The JCL required for this routine (step JCL only) would look similar to the following:
//TEST01 EXEC EASYPLUS,ACCOUNT=ISP27,VER=TEST,TBLVER=PROD //SISTRN DD DSN=AUP07.SIS.INST2.SISTRN,DISP=SHR //SYSIN DD * %TEST01 'BASE' /*
The checking of the ACRTTS table is done through Easytrieve Plus code that uses a SQL DECLARE CURSOR. The name of the cursor is BTCUR, which is defined in the SI0900A Include. It is this Include that uses the &SISVER Macro variable. This Macro variable contains the owner code of the DB2 ACRTTS table to be used, e.g., BASE, INST, TEST or PROD).