COBOL + DB2 complication process.
There are various step involved before we run/execute a
COBOL + DB2 program.
Below step are the various steps.
- Precompile.
- Compile.
- Link edit.
- Bind.
- Package & plan.
Step 1: Precompile
COBOL compiler did not understand about SQL statement so, it
undergoes to precompile.
In precompile.
- Expands all include copybooks which are written in program.
- Extracts all SQL statements into DBRM and SQL statement are convert into call statements.
- Generates time-stamp for modified source codes and DBRM .there are checked at run time.
- Check syndicated error of SQL statements and validates the fields based on the table declaration from dclgen copybook.
DSNHPC ----------- It
is the program used for precompilation.
Step 2: Compile
It is same as normal
COBOL compilation.it takes modified source as input and compilers.
IGYRCTL--------This
program is used for compilation.
Step 3: Link edit
This takes object module from compiler step and also takes
sub program load modules and generates load module.
IEWL-------------it
is program to link edit object module.
Step 4: Bind
DBRM which is extracted in the precompilation is not in executable.it has undergo through bind process which makes statements executable.
- Checks all syntax SQL queries with the DB2 cataloged entries and also check which are left by precompile.
- Check authorization of the
programmer on the SQL statement.
Bind takes DBRM as input and creates
a packages which contains of optimized access path with the help of optimizer
which checks the table statistics.
Table statistics:
1. Number
of columns
2. Number
of rows
3. Primary
Keys is available or not.
4. Foreign
keys is available or not.
What is DB2 catalog?
Package:
A package is a single bond DBRM
which contains optimized access path (OAP) to DB2.
Package contains one or more
DBRMS.
It’s an intermediate component
between Plan and DBRM.
The main advantage of the package
is, rebind is not required when any change in sub program. Compilation of
subprogram is only sufficient.
Plan:
Plan contains also optimized access path, which is executable
component.
By using the Plan we execute the package.
Plan have below things
1. One
or more DBRM.
2. One
or more package.
3. Combination
of both DBRM & package.
Group of packages is called collection.
//STEP01 EXEC PGM= IKJEFT01
//SYSTSIN DD *
DSN
BIND PLAN(plan‐name)
VALIDATE(validate‐opt)
‐> BIND, RUN
MEMBER(DBRM‐member‐name)
ISOLATION(isolation level) ‐>
CS,RR,UR
RELEASE(release‐options) ‐>
COMMIT, DEALLOCATE
LIB(‘DBRM LIBRARY’) ISOLATION
/*
VALIDATE:
Validate
used to control the handling of objects.
The
validate options are RUN, BIND.
Validate
will not through any error messages during the bind and it will through warning
messages at the time of Running.
MEMBER:
MEMBER is nothing but the DBRM name for the program stored in
the DBRM library.
ISOLATION:
ISOLATION will used to determine how much time the program bound
to the package can be isolated from the effect of other programs execution.
In other words, how the program execution is isolated for
accessing the database which is accessed by the other programs concurrently.
Database can be accessed by the multiple users at a time
(Concurrency). The Isolation level is the way to maintain the concurrency for
the multiple users by setting the levels of access to the database.
Comments
Post a Comment