Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in


Regarding PLAN and PACKAGES

Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message

New User

Joined: 01 Mar 2005
Posts: 15
Location: chennai

PostPosted: Thu Mar 24, 2005 3:33 pm    Post subject: Regarding PLAN and PACKAGES
Reply with quote

while binding 2 process are taking place namely,
2.what is actually presenty in package?
3. why we are using plan name for a pgm?
Back to top
View user's profile Send private message


Active User

Joined: 14 Mar 2005
Posts: 123

PostPosted: Thu Mar 24, 2005 7:18 pm    Post subject:
Reply with quote

2.what is actually presenty in package?
3. why we are using plan name for a pgm?

Hi friend
Package contains the optimize access path.
We use load module and plan name for execution of a cobol-db2 program.plan contains the packagelist along with the pointer to the package.
Back to top
View user's profile Send private message

Active User

Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Thu Mar 24, 2005 7:31 pm    Post subject:
Reply with quote

Package and plan are usually used synonomously. Both contain optimized code for SQL statements - a package for a single program, module or subroutine contained in the datebase request module (DBRM) library.

A plan may contain multiple packages and pointers to packages. The one program would then exist in a package that could be referenced in two different plans.

It is compulsary to use plan name for every DB2 program because the Cobol we are using dont know how to access the DB2 resources. That Information will be there in Packages and Plans.

What is a plan?

A plan is an executable module containing the access path logic produced by the DB2 optimizer. It can be composed of one or more DBRMs and packages. Before a DB2 for z/OS program (with static SQL) can be run, it must have a plan associated with it.

Plans are created by the BIND command. The plan is stored in the DB2 directory and accessed when its program is run. Information about the plan is stored in the DB2 catalog.

What is a package?

A package is a single, bound DBRM with optimized access paths. By using packages, the table access logic is "packaged" at a lower level of granularity than a plan -- at the package (or program) level.

To execute a package, you first must include it in the package list of a plan. Packages are not directly executed, they are only indirectly executed when the plan in which they are contained executes -- as discussed previously, UDFs and triggers are exceptions to this rule. A plan can consist of one or more DBRMs, one or more packages or, a combination of packages and DBRMs.

What is program preparation?

A DB2 application program must go through a process known as program preparation before it can run successfully. Program preparation requires a series of code preprocessors that when enacted in the proper sequence, create an executable load module and a DB2 application plan. The combination of the executable load module and the application plan is required before any DB2 program can be run, whether batch or online. CICS programs require an additional preprocessing step.

The first step is precompilation. DB2 programs must be parsed and modified before normal compilation. The DB2 precompiler performs this task. At a high level, the precompiler basically searches for SQL, strips it out of the program and puts it into a DBRM. The output of precompilation is a DBRM with SQL and a modified source program.

The DBRM is bound using the BIND command, which is a type of compiler for SQL statements. In general, BIND reads SQL statements from DBRMs and produces a mechanism to access data as directed by the SQL statements being bound.

The modified source is compiled using the language compiler of your choice. The compiled source then is link-edited to an executable load module. The appropriate DB2 host language interface module also must be included by the link edit step. This interface module is based on the environment (TSO, CICS, or IMS/TM) in which the program will execute.

At the end of this series of steps, if all goes well, you will have an executable DB2 program.

For more information refer to the previous topics of this forum in DB2.

Back to top
View user's profile Send private message

New User

Joined: 28 Jul 2005
Posts: 86
Location: Chennai

PostPosted: Thu Sep 01, 2005 2:41 pm    Post subject: Could you please brief me about Bind and Bind Parameter
Reply with quote

Hi Reddy,

Could you plz explain me about Db2 Bind and Parameter that will effect Lock icon_question.gif .. what is the benefit of package icon_question.gif - what is Versioning of Packages:?: ...
Can u explain briefly plz
Bye icon_question.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1


Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Program and its corresponding plan vickey_dw DB2 4 Thu Apr 07, 2016 9:27 pm
No new posts Should we Rebind Plan if no SQL changes sappy_mf DB2 2 Thu Mar 03, 2016 2:13 pm
No new posts What's plan, package, bind ? jackzhang75 DB2 2 Sun Feb 28, 2016 7:29 pm
No new posts DB2 plan for DSNTEP2 / DSNTEP4 Mainak_Dalal DB2 3 Thu Jan 21, 2016 1:08 am
No new posts Multiple COBOL-DB2 pragrams calling b... deepak_shrivastava DB2 1 Wed Jan 06, 2016 3:45 pm

Back to Top
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us