Basic DCLGEN/COBOL question

Victor Gil

Basic DCLGEN/COBOL question
I am probably missing something obvious, but when our DBAs run the DCLGEN it produces a COBOL copybook with 01 level, which effectively precludes it from being INCLUDEd more than once in any COBOL source. Meanwhile, we often need to define it at least twice - in the working storage for the SQL calls and also in the Linkage section, to map an in-core area.

Does anyone know how to make the DCLGEN to instead generate, say, 05 level?

Yes, we can create our own COBOL copybooks with any levels we want but then they might get out of synch with the table definitions.

Thanks in advance!
-Victor-


This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.


_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
Mentoring should be a rewarding experience for everyone...
IDUG is offering up to 80% off when you both come to the conference!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Binyamin Dissen

Re: Basic DCLGEN/COBOL question
(in response to Victor Gil)
On Thu, 20 Jan 2011 12:40:12 -0500 "Gil, Victor x28091"
<[login to unmask email]> wrote:

:>I am probably missing something obvious, but when our DBAs run the DCLGEN it produces a COBOL copybook with 01 level, which effectively precludes it from being INCLUDEd more than once in any COBOL source. Meanwhile, we often need to define it at least twice - in the working storage for the SQL calls and also in the Linkage section, to map an in-core area.

:>Does anyone know how to make the DCLGEN to instead generate, say, 05 level?

:>Yes, we can create our own COBOL copybooks with any levels we want but then they might get out of synch with the table definitions.

COPY member REPLACING == 01 == BY == 05 ==

More than one way to skin a cat.

--
Binyamin Dissen <[login to unmask email]>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
Mentoring should be a rewarding experience for everyone...
IDUG is offering up to 80% off when you both come to the conference!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Victor Gil

Re: Basic DCLGEN/COBOL question
(in response to Binyamin Dissen)
Thanks!
Except, the COPY requires members to come from SYSLIB, while in our [custom] source management system it does not include the DCLGEN libraries.

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
Mentoring should be a rewarding experience for everyone...
IDUG is offering up to 80% off when you both come to the conference!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Binyamin Dissen

Re: Basic DCLGEN/COBOL question
(in response to Victor Gil)
On Thu, 20 Jan 2011 13:53:22 -0500 Victor Gil <[login to unmask email]>
wrote:

:>Thanks!
:>Except, the COPY requires members to come from SYSLIB, while in our [custom] source management system it does not include the DCLGEN libraries.

If you don't use COPY, how does it get into your source in such a way that a
new DCLGEN will update it?

--
Binyamin Dissen <[login to unmask email]>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
Mentoring should be a rewarding experience for everyone...
IDUG is offering up to 80% off when you both come to the conference!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Victor Gil

Re: Basic DCLGEN/COBOL question
(in response to Binyamin Dissen)
By means of

EXEC SQL INCLUDE member END-EXEC

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
Mentoring should be a rewarding experience for everyone...
IDUG is offering up to 80% off when you both come to the conference!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Binyamin Dissen

Re: Basic DCLGEN/COBOL question
(in response to Victor Gil)
On Thu, 20 Jan 2011 14:27:19 -0500 Victor Gil <[login to unmask email]>
wrote:

:>By means of

:>EXEC SQL INCLUDE member END-EXEC

Can you change that include member to be

COPY ........

which COBOL will process after the precompile?

True, you will get DSNH050I - but what is more important?

--
Binyamin Dissen <[login to unmask email]>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
Mentoring should be a rewarding experience for everyone...
IDUG is offering up to 80% off when you both come to the conference!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

Victor Gil

Re: Basic DCLGEN/COBOL question
(in response to Binyamin Dissen)
If I had the authority to update the DCLGEN members, I would just manually make the change from 01 to 05 and be done.

_____________________________________________________________________
* IDUG North America * Anaheim, California * May 2-6 2011 * http://IDUG.ORG/NA *
* Your only source for independent, unbiased, and trusted DB2 information. *
_____________________________________________________________________
http://www.IDUG.org/mentor
Mentoring should be a rewarding experience for everyone...
IDUG is offering up to 80% off when you both come to the conference!
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv

David Churn

Re: Basic DCLGEN/COBOL question
(in response to Victor Gil)
Victor (& listers),

EXEC SQL INCLUDE ... END-EXEC. Does not have a replace option and is
needed for use with SQL using the precompiler.
COPY ... Allows changes but cannot be used in precompiled SQL.

Based on the traffic, I would recommend that you update the LINKAGE
SECTION copybooks to use the COPY ... REPLACING and update the compile
job's copybook file concatenation to include the DB2 table
definitions.

Other solutions include,
creating your own copybook from the DCLGEN definition (requiring
another copy & change when the table changes)
changing the generated DCLGEN (which was ruled out)
building your own copybook generator (time consuming)
switch from using the precompiler to the coprocessor for compiles
(radical change)

You could also request IBM change the DB2 INCLUDE statement to allow
replacing like the COBOL COPY statement. Please let me know if they
agree to this change.

If you have any questions, please contact me.

--
David Churn
Database Architect, DST Systems, Inc.

On Thu, Jan 20, 2011 at 1:57 PM, Victor Gil <[login to unmask email]> wrote:
> If I had the authority to update the DCLGEN members, I would just manually make the change from 01 to 05 and be done.
>
> _____________________________________________________________________
> * IDUG North America * Anaheim, California * May 2-6 2011 *  http://IDUG.ORG/NA *
> *   Your only source for independent, unbiased, and trusted DB2 information.   *
> _____________________________________________________________________
> http://www.IDUG.org/mentor
> Mentoring should be a rewarding experience for everyone...
> IDUG is offering up to 80% off when you both come to the conference!
> _____________________________________________________________________
>
> If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv
>

_____________________________________________________________________
* IDUG EMEA * Prague, Czech Republic * 14-18 November 2011 * http://IDUG.ORG/EMEA *
* If you are going to attend only one conference this year, this is it! *
** The most DB2 technical sessions of any conference
** Access IBM experts and developers
_____________________________________________________________________

If you need to change settings, http://www.idug.org/cgi-bin/wa?A0=DB2-L is the home of IDUG's Listserv