Because your migrated application originated in a mainframe environment, the run-time application expects to find all of the appropriate SQL statements in packages and/or plans that reference database request modules (DBRMs). DBRMs contain the SQL statements extracted from the application source code during compilation.
To mimic this mainframe behavior, HCOSS provides a set of SQL compiler directive options that enable you to extract the EXEC SQL statements in your application source code into DBRMs as you compile the application. In a post-compilation step, you then bind the DBRMs to the application so that they can be accessed at run time.
The following sample use case scenarios show typical SQL compiler directives you might set for HCOSS applications:
Type of Program | Scenario | SQL Compiler Directive Options |
---|---|---|
COBOL | Create DBRMs, and bind like the mainframe | SQL(DBMAN={ODBC | ADO}, TARGETDB=MSSQLSERVER, DB=databaseName, [PASS=userid.password, ]BEHAVIOR=MAINFRAME, DIALECT=MAINFRAME, DBRMLIB)1 |
COBOL | Create DBRMs, bind like the mainframe, but do not connect to the database during compilation | SQL(DBMAN={ODBC | ADO}, TARGETDB=MSSQLSERVER,BEHAVIOR=MAINFRAME, DIALECT=MAINFRAME, DBRMLIB, NOCHECK)1 |
COBOL | Do not create DBRMs, and do not create SQL Server stored procedures | SQL(DBMAN={ODBC | ADO}, TARGETDB=MSSQLSERVER, DB=databaseName, [PASS=userid.password, ] BEHAVIOR=MAINFRAME, DIALECT=MAINFRAME)1 |
COBOL | Do not create DBRMs, do not create SQL Server stored procedures, and do not connect to the database during compilation | SQL(DBMAN={ODBC | ADO}, TARGETDB=MSSQLSERVER, BEHAVIOR=MAINFRAME, DIALECT=MAINFRAME, NOCHECK)1 |
PL/I | Create DBRMs, and bind like the mainframe | SQL(DBMAN=ODBC, TARGETDB=MSSQLSERVER, DB=databaseName, [PASS=userid.password, ] BEHAVIOR=MAINFRAME, DIALECT=MAINFRAME, DBRMLIB)1 |
PL/I | Create DBRMs, bind like the mainframe, but do not connect to the database during compilation | SQL(DBMAN=ODBC, TARGETDB=MSSQLSERVER, DB=databaseName, [PASS=userid.password, ] BEHAVIOR=MAINFRAME, DIALECT=MAINFRAME, DBRMLIB, NOCHECK)1 |
1 DIALECT=MAINFRAME automatically sets CHECK, CHECKDUPCURSOR, CHECKSINGLETON, DETECTDATE, DATE=ISO, TIME=ISO |
In Visual Studio, you compile applications by building the projects that contain them. When you build an HCOSS application, you must first set appropriate SQL compiler directive options, and in most cases, establish a connection to your SQL Server database.
userID.password
Before compiling, unless you have specified the SQL(NOCHECK) directive, you must be connected to the database specified by the DB directive via an ODBC (native applications) or an ADO.NET (managed applications) connection.