Static SQL - COBOL PRE-COMPILE process

 

STEP 1 -  DB2 PRECOMPILE Process
The DB2 Precompile performs three functions:
1. It adds working storage areas and source code compatible statmens that are used to invoke DB2. (such as, INCLUDE, Precompiler will search the included memeber from pre-defined lib, then copy it to program when it is found.)
2. It checks the SQL in the program for errors, which use DCLGEN to check the SQL syntax. (Precomiler does't use DB2 sub-system and CATALOG in precompile stage)
3. Finally, all of the SQL statements are extracted from the program source and placed into a member called the DataBase Request Module, or DBRM, which also contains the consistency token.

STEP 2 - COMPILE
The modified source from the precompile is then compiled. The code is checked for errors, and a compiled version of the code is created.

STEP 3 - LINK-EDIT
The compiled code is link-edited along with statically called source language and DB2 run-time modules to create a Load Module. Imbedded in this module is the same consistency token that was generated in the precompile. If multiple DB2 programs are statically linked together, the resulting load module contains a consistency token for each one.

STEP 4 - DB2 BIND
The bind process reads the DBRM that was created in the precompile and prepares an access path to the data. This access path, along with the consistency token, is stored in the DB2 catalog as a Package. Every Package is bound into a Package List, or Collection. The name of the Collection is specified by the PACKAGE parameter. A Collection is a group of Packages  that are included in one or more Plans. The QUALIFIER parameter of the bind is used to direct the SQL to the specific set of DB2 objects (tables, views, aliases or synonyms) qualified by this name.


 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值