create a Collection

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
David Hunter
Member
Posts: 4
Joined: Thu Feb 02, 2012 6:57 pm
Location: Columbia, SC

create a Collection

Post by David Hunter » Thu Feb 02, 2012 8:23 pm

My programmers frequently receive a -805. I've been told that to resolve this problem that I could create a collection for each of them. Does anyone have an example of how to do this?

Thanks.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Fri Feb 03, 2012 3:20 pm

Are you a(n) DBA?
Regards,
Anuj

David Hunter
Member
Posts: 4
Joined: Thu Feb 02, 2012 6:57 pm
Location: Columbia, SC

create a Collection

Post by David Hunter » Fri Feb 03, 2012 6:08 pm

yes, I'm a DBA, thanks for asking. But I'm new to DB2. Majority of my experience is an Adabas admin. I've asked several DB2 admins about this but none have actually done this. Do you have any input?

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Fri Feb 03, 2012 7:46 pm

in what environment are the programmers receiving the -805
an -805 simply means the db2 cat does not match the loadmodule invoked.

in cics environment this is common when the NEW COPY is overlooked.
in batch, when the worng loadlib is STEPed.
it can be due also to a bind failure. -
normally, after the linkedit you have a new load - the old has been deleted.
if the bind process does not complete, then the latest package/coll is actually for the last loadmodule created.

there is a redbook you may want to read: http://www.redbooks.ibm.com/abstracts/s ... .html?Open
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

David Hunter
Member
Posts: 4
Joined: Thu Feb 02, 2012 6:57 pm
Location: Columbia, SC

Post by David Hunter » Fri Feb 03, 2012 7:54 pm

DB2 Batch Cobol job. I'm not concerned with the -805. What I want to know is during the BIND how to specify a Collection.

TIA

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Sat Feb 04, 2012 6:21 am

read the redbook from the link.

using collections will not solve your -805's.
only training of your rookie programmers will do that.

depending on db2 version, it has been suggested that everyone
migrate to using collections or packages, i don't remember which,
but the redbook lays it out,
and why.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Re: create a Collection

Post by Anuj Dhawan » Sat Feb 04, 2012 2:40 pm

David Hunter wrote:yes, I'm a DBA, thanks for asking. But I'm new to DB2. Majority of my experience is an Adabas admin. I've asked several DB2 admins about this but none have actually done this. Do you have any input?
I see. Short answer is - a collection is simply a way of grouping PACKAGEs into meaningful groups. You could use COLLECTIONs to separate programs for different application areas, e.g. payroll and inventory. Another use might be to have customized set of BIND parameters associated with different COLLECTIONs.

Saying only this much sounds as a half answer. Reading further might be interesting for you. This is from an old DB2 magazine, have modified it a bit where ever I felt I could:

The DB2 Pre-compiler splits the program into two parts: a COBOL and a DB2 part.

The embedded SQL is stripped out of the program and put into a partitioned data set (PDS) member, called a DBRM. Just as the COBOL part has to be compiled, the DBRM part has to go through BIND process to create the run-time executable code for the DB2 portion of the COBOL program. To help the COBOL and DB2 part to find each other later at run time, the precompiler engraves each with identical timestamps called consistency tokens.

You can BIND the DBRM into a PLAN (the old way), or you can BIND the instructions into a PACKAGE. A PLAN is an executable module containing the access path logic produced by the DB2 optimizer. The DBRMs of more than one program or PACKAGES can be bound into a PLAN.

A PACKAGE is a single, bound DBRM with optimized access paths. The DBRM of a single program is bound into a PACKAGE. To execute a PACKAGE, it should be included 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. So, the relationship between a DBRM and a PLAN is one-to-many, the relationship between a DBRM and a PACKAGE is always one-to-one.

As the number of DBRMs bound to a PLAN increases, binding the DBRM into a PLAN is not recommended. If we need to precompile and bind a new program or one of the programs changes and it is to be precompiled and bound again, all the programs (not just the modified/added program) will be rebound into the PLAN again. Then the BIND process could take hours to complete.

On the other hand, if a DBRM is bound to a PACKAGE and if the program is modified, only that PACKAGE would have to be rebound.

Said all that a term collections comes in, as I said in short answer -- a collection is simply a way of grouping PACKAGEs into meaningful groups. You could use COLLECTIONs to separate programs for different application areas, such as payroll and inventory. Another use might be to have customized set of BIND parameters associated with different COLLECTIONs. At run time, the load module starts up and eventually hits a paragraph containing a CALL to DB2. Then the COLLECTIONs named in the PLAN are searched for the PACKAGE with the same name and consistency token. If you don't find it anywhere in DB2, you get an -805 error.

If you're using the older technique of binding DBRMs directly into PLANs, then an unsuccessful search will result in an -818 error code.

Hope this helps.
Regards,
Anuj

David Hunter
Member
Posts: 4
Joined: Thu Feb 02, 2012 6:57 pm
Location: Columbia, SC

Post by David Hunter » Mon Feb 06, 2012 6:35 pm

Thanks for the useful replies.

Dick, thanks for the redbook link.

Anuj, thanks for the information.

Both were very helpful.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Feb 07, 2012 10:40 pm

You're welcome - I hope you get what you were looking for.
Regards,
Anuj

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others