[DB2 for z/OS] Precompiling C code with square brackets

Raymond Bell

[DB2 for z/OS] Precompiling C code with square brackets
All,

We're now DB2 V8 CM everywhere, and starting to plan to go to ENFM. The
last step in the CM migration plan is to turn on the V8 Precompiler with
NEWFUN(NO). And we have a small problem.

It seems that the DCLGEN program produces C copybooks substituting left
square brackets [ with two question marks and a left bracket ??( And
substitutes ] with ??). Apparently the V7 precompiler is happy in the
knowledge that these characters are really square brackets and accepts them.
However the V8 precompiler seems to be complaining that it doesn't know what
these 3-byte characters are. An example of a partial DCLGEN from my
PLAN_TABLE might make it clearer:

/*********************************************************************/
/* DCLGEN TABLE(RB55539.PLAN_TABLE) */
/* LIBRARY(RB55539.LIB.CNTL(DCLGENV8)) */
/* ACTION(REPLACE) */
/* LANGUAGE(C) */
/* APOST */
/* ... IS THE DCLGEN COMMAND THAT MADE THE FOLLOWING STATEMENTS */
/*********************************************************************/
EXEC SQL DECLARE RB55539.PLAN_TABLE TABLE
( QUERYNO INTEGER NOT NULL,
QBLOCKNO SMALLINT NOT NULL,
APPLNAME CHAR(8) NOT NULL,
PROGNAME CHAR(8) NOT NULL,
PLANNO SMALLINT NOT NULL,
METHOD SMALLINT NOT NULL,
...
/*********************************************************************/
/* C DECLARATION FOR TABLE RB55539.PLAN_TABLE */
/*********************************************************************/
struct
{ long int QUERYNO;
short int QBLOCKNO;
char APPLNAME??(9??);
char PROGNAME??(9??);
short int PLANNO;
short int METHOD;
...


What I'd like is either the brackets to be honoured correctly by the
precompiler or, arguably better, for DCLGEN to generate square brackets in
the first place:

...
struct
{ long int QUERYNO;
short int QBLOCKNO;
char APPLNAME[9];
char PROGNAME[9];
short int PLANNO;
short int METHOD;
...

Or, even better still, for DCLGEN to generate square brackets and for the
precompiler to deal with either output.

So, question time. Does anyone know how/where/if this stuff is controlled
somewhere? How can I get square brackets produced by DCLGEN and/or get the
V8 precompiler to deal with ??( and ??) in the same way the V7 precompiler
seems to?

All thoughts gratefully received.


Raymond Bell
Database Administrator


This e-mail (and any attachments) may contain privileged and/or confidential information. If you are not the intended recipient please do not disclose, copy, distribute, disseminate or take any action in reliance on it. If you have received this message in error please reply and tell us and then delete it. Should you wish to communicate with us by e-mail we cannot guarantee the security of any data outside our own computer systems. For the protection of Legal & General's systems and staff, incoming emails will be automatically scanned.

Any information contained in this message may be subject to applicable terms and conditions and must not be construed as giving investment advice within or outside the United Kingdom.

The following companies are subsidiary companies of the Legal & General Group Plc which are authorised and regulated by the Financial Services Authority for advising and arranging the products shown: Legal & General Partnership Services Limited (insurance and mortgages), Legal & General Insurance Limited (insurance), Legal & General Assurance Society Limited
(life assurance, pensions and investments), Legal & General Unit Trust Managers Limited and Legal & General Portfolio Management Services Limited (investments).

They are registered in England under numbers shown.
The registered office is Temple Court, 11 Queen Victoria Street, London EC4N 4TP.

Legal & General Partnership Services Limited: 5045000 Legal & General Assurance Society Limited: 166055 Legal & General (Unit Trust Managers) Limited: 1009418 Legal & General (Portfolio Management Services) Limited: 2457525 Legal & General Insurance Limited: 423930

They are registered with the Financial Services Authority under numbers shown. You can check this at www.fsa.gov.uk/register

Legal & General Partnership Services Limited: 300792 Legal & General Assurance Society Limited: 117659 Legal & General (Unit Trust Managers) Limited: 119273 Legal & General (Portfolio Management Services) Limited: 146786 Legal & General Insurance Limited: 202050


---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Paul Walters

Re: [DB2 for z/OS] Precompiling C code with square brackets
(in response to Raymond Bell)
Use the CCSID(1047) precompile option to precompile this program.

You might want to look at this link:

http://www-1.ibm.com/support/docview.wss?rs=64&context=SSEPEK&dc=DB520&uid=swg21170680&loc=en_US&cs=UTF-8&lang=en&rss=ct64db2




>>> [login to unmask email] 12/06/06 11:39 AM >>>
All,

We're now DB2 V8 CM everywhere, and starting to plan to go to ENFM.
The
last step in the CM migration plan is to turn on the V8 Precompiler
with
NEWFUN(NO). And we have a small problem.

It seems that the DCLGEN program produces C copybooks substituting
left
square brackets [ with two question marks and a left bracket ??( And
substitutes ] with ??). Apparently the V7 precompiler is happy in the
knowledge that these characters are really square brackets and accepts
them.
However the V8 precompiler seems to be complaining that it doesn't know
what
these 3-byte characters are. An example of a partial DCLGEN from my
PLAN_TABLE might make it clearer:


/*********************************************************************/
/* DCLGEN TABLE(RB55539.PLAN_TABLE)
*/
/* LIBRARY(RB55539.LIB.CNTL(DCLGENV8))
*/
/* ACTION(REPLACE)
*/
/* LANGUAGE(C)
*/
/* APOST
*/
/* ... IS THE DCLGEN COMMAND THAT MADE THE FOLLOWING STATEMENTS
*/

/*********************************************************************/
EXEC SQL DECLARE RB55539.PLAN_TABLE TABLE

( QUERYNO INTEGER NOT NULL,

QBLOCKNO SMALLINT NOT NULL,

APPLNAME CHAR(8) NOT NULL,

PROGNAME CHAR(8) NOT NULL,

PLANNO SMALLINT NOT NULL,

METHOD SMALLINT NOT NULL,

...
/*********************************************************************/
/* C DECLARATION FOR TABLE RB55539.PLAN_TABLE
*/
/*********************************************************************/
struct

{ long int QUERYNO;

short int QBLOCKNO;

char APPLNAME??(9??);

char PROGNAME??(9??);

short int PLANNO;

short int METHOD;

...


What I'd like is either the brackets to be honoured correctly by the
precompiler or, arguably better, for DCLGEN to generate square brackets
in
the first place:

...
struct

{ long int QUERYNO;

short int QBLOCKNO;

char APPLNAME[9];
char PROGNAME[9];
short int PLANNO;

short int METHOD;

...

Or, even better still, for DCLGEN to generate square brackets and for
the
precompiler to deal with either output.

So, question time. Does anyone know how/where/if this stuff is
controlled
somewhere? How can I get square brackets produced by DCLGEN and/or get
the
V8 precompiler to deal with ??( and ??) in the same way the V7
precompiler
seems to?

All thoughts gratefully received.


Raymond Bell
Database Administrator


This e-mail (and any attachments) may contain privileged and/or
confidential information. If you are not the intended recipient please
do not disclose, copy, distribute, disseminate or take any action in
reliance on it. If you have received this message in error please reply
and tell us and then delete it. Should you wish to communicate with us
by e-mail we cannot guarantee the security of any data outside our own
computer systems. For the protection of Legal & General's systems and
staff, incoming emails will be automatically scanned.

Any information contained in this message may be subject to applicable
terms and conditions and must not be construed as giving investment
advice within or outside the United Kingdom.

The following companies are subsidiary companies of the Legal & General
Group Plc which are authorised and regulated by the Financial Services
Authority for advising and arranging the products shown: Legal & General
Partnership Services Limited (insurance and mortgages), Legal & General
Insurance Limited (insurance), Legal & General Assurance Society Limited

(life assurance, pensions and investments), Legal & General Unit Trust
Managers Limited and Legal & General Portfolio Management Services
Limited (investments).

They are registered in England under numbers shown.
The registered office is Temple Court, 11 Queen Victoria Street, London
EC4N 4TP.

Legal & General Partnership Services Limited: 5045000 Legal & General
Assurance Society Limited: 166055 Legal & General (Unit Trust Managers)
Limited: 1009418 Legal & General (Portfolio Management Services)
Limited: 2457525 Legal & General Insurance Limited: 423930

They are registered with the Financial Services Authority under numbers
shown. You can check this at www.fsa.gov.uk/register

Legal & General Partnership Services Limited: 300792 Legal & General
Assurance Society Limited: 117659 Legal & General (Unit Trust Managers)
Limited: 119273 Legal & General (Portfolio Management Services) Limited:
146786 Legal & General Insurance Limited: 202050


---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and
home page at http://www.idugdb2-l.org/archives/db2-l.html. From that
page select "Join or Leave the list". The IDUG DB2-L FAQ is at
http://www.idugdb2-l.org. The IDUG List Admins can be reached at
[login to unmask email] Find out the latest on IDUG
conferences at http://conferences.idug.org/index.cfm


This E-Mail has been scanned for viruses.

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm

Raymond Bell

Re: [DB2 for z/OS] Precompiling C code with square bracke ts
(in response to Paul Walters)
Paul,

Thanks for the tip. Once I knew what to look for I could find references to
precompiling C programs with CCSID(1047) in loads of places. Typical.

We also can't deal with the split vertical bar (x'6A'). I raised it with
IBM who have, I believe, accepted it as a PTF. So when that becomes
available and we precompile using 1047 we should be in the clear.

Thanks again,


Raymond Bell
Database Administrator

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On Behalf
Of PAUL WALTERS
Sent: 06 December 2006 16:55
To: [login to unmask email]
Subject: Re: [DB2-L] [DB2 for z/OS] Precompiling C code with square brackets

Use the CCSID(1047) precompile option to precompile this program.

You might want to look at this link:

http://www-1.ibm.com/support/docview.wss?rs=64&context=SSEPEK&dc=DB520&uid=s
wg21170680&loc=en_US&cs=UTF-8&lang=en&rss=ct64db2




This e-mail (and any attachments) may contain privileged and/or confidential information. If you are not the intended recipient please do not disclose, copy, distribute, disseminate or take any action in reliance on it. If you have received this message in error please reply and tell us and then delete it. Should you wish to communicate with us by e-mail we cannot guarantee the security of any data outside our own computer systems. For the protection of Legal & General's systems and staff, incoming emails will be automatically scanned.

Any information contained in this message may be subject to applicable terms and conditions and must not be construed as giving investment advice within or outside the United Kingdom.

The following companies are subsidiary companies of the Legal & General Group Plc which are authorised and regulated by the Financial Services Authority for advising and arranging the products shown: Legal & General Partnership Services Limited (insurance and mortgages), Legal & General Insurance Limited (insurance), Legal & General Assurance Society Limited
(life assurance, pensions and investments), Legal & General Unit Trust Managers Limited and Legal & General Portfolio Management Services Limited (investments).

They are registered in England under numbers shown.
The registered office is Temple Court, 11 Queen Victoria Street, London EC4N 4TP.

Legal & General Partnership Services Limited: 5045000 Legal & General Assurance Society Limited: 166055 Legal & General (Unit Trust Managers) Limited: 1009418 Legal & General (Portfolio Management Services) Limited: 2457525 Legal & General Insurance Limited: 423930

They are registered with the Financial Services Authority under numbers shown. You can check this at www.fsa.gov.uk/register

Legal & General Partnership Services Limited: 300792 Legal & General Assurance Society Limited: 117659 Legal & General (Unit Trust Managers) Limited: 119273 Legal & General (Portfolio Management Services) Limited: 146786 Legal & General Insurance Limited: 202050

---------------------------------------------------------------------------------
Welcome to the IDUG DB2-L list. To unsubscribe, go to the archives and home page at http://www.idugdb2-l.org/archives/db2-l.html. From that page select "Join or Leave the list". The IDUG DB2-L FAQ is at http://www.idugdb2-l.org. The IDUG List Admins can be reached at [login to unmask email] Find out the latest on IDUG conferences at http://conferences.idug.org/index.cfm