When generating the SESAM/SQL-UTM application it must be specified that the UTM application is to communicate with the SESAM/SQL database system. This is done with the KDCDEF DATABASE statement, see below.
The KDCDB macro which is needed to translate the KDCROOT table module is located in the SESAM/SQL macro library for UTM applications. The other macros are in the UTM macro library. Both the macros from the UTM macro library and the KDCDB macro must be available for assembling.
KDCDEF statement DATABASE
DATABASE ENTRY=SESSQL,TYPE=SESAM | for SQL |
DATABASE ENTRY=SESAM,TYPE=SESAM | for CALL-DML |
LIB= | If the parameter LIB= is set, the SESAM connection module SESUTMC will |
modlib | Name of the BS2000 library containing the SESAM modules. This |
LOGICAL-ID(SYSLNK) | The SESAM connection module will be searched for in the IMON installation path for the SESAM/SQL module libraries and loaded from there. |
If SQL and CALL DML are to be used, both statements must be specified, see also “Example 2”.
Recommendations
It is advisable to statically link the SESAM connection module to the UTM application module. In this case you must not specify the parameter LIB= in the KDCDEF statement DATABASE. The static link has the advantage that the generated UTM application will not have to be re-generated after a SESAM version change.
If the SESAM connection module is not statically linked to the UTM application then LIB=LOGICAL-ID(SYSLNK) should be specified. In this case, the UTM application, with regard to SESAM/SQL, is not dependent on hardware- or version-dependent installation paths or library names. A prequisite for this is a correct installation with IMON.
Example 1
The SESAM connection module is statically linked and the application does not contain any CALL-DML program units. The following DATABASE statement is therefore required:
DATABASE ENTRY=SESSQL,TYPE=SESAM
Example 2
The SESAM connection module is statically linked and the application contains CALL-DML program units. In this case the following two DATABASE statements must be specified:
DATABASE ENTRY=SESSQL,TYPE=SESAM
DATABASE ENTRY=SESAM,TYPE=SESAM
Example 3
The SESAM connection module is dynamically loaded via the IMON installation path and the application contains CALL-DML program units. Two DATABASE statements with LIB parameter must therefore be specified:
DATABASE ENTRY=SESSQL,TYPE=SESAM,LIB=LOGICAL-ID(SYSLNK)
DATABASE ENTRY=SESAM,TYPE=SESAM,LIB=LOGICAL-ID(SYSLNK)
Assemble the KDCROOT connection program
Before assembling the KDCROOT connection program, assign the SESAM macro library. The syntax depends on the assembler you are using.
Example 1
Assigning the SESAM macro library in the case of ASSEMBH:
/ADD-FILE-LINK LINK-NAME=UTMLIB,FILE-NAME=utm_maclib /ADD-FILE-LINK LINK-NAME=SESAMLIB,FILE=sesam_maclib /START-PROGRAM FROM-FILE=$ASSEMBH //COMPILE - //SOURCE=kdcroot //,MACRO-LIBRARY=(*LINK(LINK-NAME=SESAMLIB) . .
Example 2
Assigning the SESAM macro library with ASSGEN:
/FILE sesam-maclib,LINK=ALTLIB2 /EXEC $ASSGEN *COMOPT ALTLIB2 . .