COBOL + DB2 complication process.

There are various step involved before we run/execute a COBOL + DB2 program.

  Below step are the various steps.
  1.  Precompile.
  2.  Compile.
  3.  Link edit.
  4.  Bind.
  5.   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. 
 Notes: precompilation process can be executed even if DB2 is down.

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.

  1. Checks all syntax SQL queries with the DB2 cataloged entries  and also check which are left by precompile.
  2. 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?
                It is DB2 sub-system object repository; it contains system-defined tables like SYSTABLE, SYSCOLUMNS, SYSVIEWS, SYSINDEXES………………….

What do mean statistics?
  No of cols, types of index, no of indexes, no of views, types of query, no of cols…………….


 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(planname)
VALIDATE(validateopt) > BIND, RUN
MEMBER(DBRMmembername)
ISOLATION(isolation level) > CS,RR,UR
RELEASE(releaseoptions) > 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

Popular posts from this blog

ABEND list for JCL

difference between jes2 and jes3