COBOL, DB2 9 on z/OS, and a pre-compiler

David Churn

COBOL, DB2 9 on z/OS, and a pre-compiler
Listers,

I have a quick Friday question. How do you define a field to accept
the value of special register, CURRENT REFRESH AGE?

The friendly SQL reference manual states that it is a DECIMAL(20,6)
which should translate into PIC 9(14)V9(6) COMP-3. When defined this
way in a COBOL program the precompiler says
DSNH312I E DSNHSMUD LINE 445 COL 20 UNDEFINED OR UNUSABLE HOST
VARIABLE "SR-REFRESH-AGE"

I tried PIC 9(20) COMP-3 and received the same result. I also looked
in the Applications Programmers Guide and it is barely mentioned this
special register.

All clues are appreciated.
--
David Churn
Database Architect, DST Systems, Inc.
President, Heart of America DB2 Users Group

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

Kirk Hampton

Re: COBOL, DB2 9 on z/OS, and a pre-compiler
(in response to David Churn)
Hello Dave,
Sorry, but a COBOL COMP-3 data item can have no more than 18 digits. I
just checked the manual for the newest release of Enterprise COBOL from
2008, and it's still the same. So you may have to define it as COMP-5 or
something else. Sorry, I don't have the full answer, but I know why your
current attempt is failing.


Kirk Hampton
DB2 z/OS Sysprog
IBM Certified Database Administrator - DB2 UDB V8.1 for z/OS
Capgemini Energy
Dallas, Texas


-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
Behalf Of Dave Churn
Sent: Friday, January 16, 2009 1:12 PM
To: [login to unmask email]
Subject: [DB2-L] COBOL, DB2 9 on z/OS, and a pre-compiler

Listers,

I have a quick Friday question. How do you define a field to accept
the value of special register, CURRENT REFRESH AGE?

The friendly SQL reference manual states that it is a DECIMAL(20,6)
which should translate into PIC 9(14)V9(6) COMP-3. When defined this
way in a COBOL program the precompiler says
DSNH312I E DSNHSMUD LINE 445 COL 20 UNDEFINED OR UNUSABLE HOST
VARIABLE "SR-REFRESH-AGE"

I tried PIC 9(20) COMP-3 and received the same result. I also looked
in the Applications Programmers Guide and it is barely mentioned this
special register.

All clues are appreciated.
--
David Churn
Database Architect, DST Systems, Inc.
President, Heart of America DB2 Users Group

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password.
You should have gotten an e-mail with the temporary password assigned to
your account. Please log in and update your member profile. If you are
not already an IDUG.org member, please register at
http://www.idug.org/component/juser/register.html

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

Mike Bell

Re: COBOL, DB2 9 on z/OS, and a pre-compiler
(in response to Kirk Hampton)
Um, not exactly - old cobol yes but ever since enteprise cobol it now
supports the full hard ware length but it does require a compiler parm.

From the fine manual

For packed decimal and zoned decimal items the number of digit positions
must range from 1 through 18, inclusive, when the ARITH(COMPAT) compiler
option is in effect, or from 1 through 31, inclusive, when the ARITH(EXTEND)
compiler option is in effect

The actual problem is the precompiler though and I suspect that may require
the dec31 parm for precompile or open a problem with IBM because DB2 has
supported DEC31 for a long time. I would have to look where default dec31 vs
dec15 is set - think it is zparm but fine manual will explain. I do NOT know
if you would have to turn dec31 on for the subsystem to get the variable.

Mike
HLS Technologies

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On Behalf
Of Hampton, James K
Sent: Friday, January 16, 2009 2:43 PM
To: [login to unmask email]
Subject: Re: [DB2-L] COBOL, DB2 9 on z/OS, and a pre-compiler

Hello Dave,
Sorry, but a COBOL COMP-3 data item can have no more than 18 digits. I just
checked the manual for the newest release of Enterprise COBOL from 2008, and
it's still the same. So you may have to define it as COMP-5 or something
else. Sorry, I don't have the full answer, but I know why your current
attempt is failing.


Kirk Hampton
DB2 z/OS Sysprog
IBM Certified Database Administrator - DB2 UDB V8.1 for z/OS Capgemini
Energy Dallas, Texas


-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On Behalf
Of Dave Churn
Sent: Friday, January 16, 2009 1:12 PM
To: [login to unmask email]
Subject: [DB2-L] COBOL, DB2 9 on z/OS, and a pre-compiler

Listers,

I have a quick Friday question. How do you define a field to accept the
value of special register, CURRENT REFRESH AGE?

The friendly SQL reference manual states that it is a DECIMAL(20,6) which
should translate into PIC 9(14)V9(6) COMP-3. When defined this way in a
COBOL program the precompiler says
DSNH312I E DSNHSMUD LINE 445 COL 20 UNDEFINED OR UNUSABLE HOST
VARIABLE "SR-REFRESH-AGE"

I tried PIC 9(20) COMP-3 and received the same result. I also looked in the
Applications Programmers Guide and it is barely mentioned this special
register.

All clues are appreciated.
--
David Churn
Database Architect, DST Systems, Inc.
President, Heart of America DB2 Users Group

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password.
You should have gotten an e-mail with the temporary password assigned to
your account. Please log in and update your member profile. If you are not
already an IDUG.org member, please register at
http://www.idug.org/component/juser/register.html

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You
should have gotten an e-mail with the temporary password assigned to your
account. Please log in and update your member profile. If you are not
already an IDUG.org member, please register at
http://www.idug.org/component/juser/register.html

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

Peter Vanroose

Re: COBOL, DB2 9 on z/OS, and a pre-compiler
(in response to Mike Bell)
You could of course CAST(CURRENT REFRESH AGE AS DEC(18,4)) and then use
SR-REFRESH-AGE PIC 9(14)V9(4) COMP-3

-- Peter Vanroose

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

Peter Backlund

Re: COBOL, DB2 9 on z/OS, and a pre-compiler
(in response to Peter Vanroose)
You have to say PIC S9(14)V9(6) COMP-3

Peter

Dave Churn wrote: Listers, I have a quick Friday question. How do you define a field to accept the value of special register, CURRENT REFRESH AGE? The friendly SQL reference manual states that it is a DECIMAL(20,6) which should translate into PIC 9(14)V9(6) COMP-3. When defined this way in a COBOL program the precompiler says DSNH312I E DSNHSMUD LINE 445 COL 20 UNDEFINED OR UNUSABLE HOST VARIABLE "SR-REFRESH-AGE" I tried PIC 9(20) COMP-3 and received the same result. I also looked in the Applications Programmers Guide and it is barely mentioned this special register. All clues are appreciated.
No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.8/1898 - Release Date: 2009-01-16 15:09
-- Attend IDUG 2009, North America -- 11-15 May in Denver, Colorado Attend IDUG 2009, Europe -- 5- 9 October in Rome, Italy Learn more at http://www.idug.org +-------------------------------+---------------------------------+ | Peter G Backlund | Telephone: 08 - 38 69 08 | | Peter Backlund DB2-Konsult AB | Mobile: 070 - 764 7554 | | Rasundavagen 94 | Country Code (Sweden): 46 | | S-169 57 SOLNA | Skype: BacklundDB2 | | Sweden | E-mail: [login to unmask email] | +-------------------------------+---------------------------------+ | IBM Database GOLD Consultant | +-------------------------------+---------------------------------+ | Working with DB2 since 1981 ... and forever! | +-----------------------------------------------------------------+

IDUG 2009 - Australasia * 18-20 March * Melbourne, Australia

IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register here.

David Churn

Re: COBOL, DB2 9 on z/OS, and a pre-compiler
(in response to Peter Backlund)
Kirk,

The 18 digit limit depends on the compiler option that you are using.
I am looking at the IBM Enterprise COBOL for z/OS V4.1 Language
Reference, Appendix B (Compiler Limits).

If ARITH(COMPAT) is specified, 18 digits is the largest number digits.
It is the default.
If ARITH(EXTEND) is specified, 31 digts is the largest number. This
is what our compiler uses.

Either way, the field still needs a sign for the pre-compiler to work.
The definition, PIC S9(14)V9(6), moved me to my compiler errors.

--
David Churn
Database Architect, DST Systems, Inc.
President, Heart of America DB2 Users Group

On Fri, Jan 16, 2009 at 2:43 PM, Hampton, James K
<[login to unmask email]> wrote:
> Hello Dave,
> Sorry, but a COBOL COMP-3 data item can have no more than 18 digits. I
> just checked the manual for the newest release of Enterprise COBOL from
> 2008, and it's still the same. So you may have to define it as COMP-5 or
> something else. Sorry, I don't have the full answer, but I know why your
> current attempt is failing.
>
>
> Kirk Hampton
> DB2 z/OS Sysprog
> IBM Certified Database Administrator - DB2 UDB V8.1 for z/OS
> Capgemini Energy
> Dallas, Texas
>
>
> -----Original Message-----
> From: DB2 Data Base Discussion List [mailto:[login to unmask email] On
> Behalf Of Dave Churn
> Sent: Friday, January 16, 2009 1:12 PM
> To: [login to unmask email]
> Subject: [DB2-L] COBOL, DB2 9 on z/OS, and a pre-compiler
>
> Listers,
>
> I have a quick Friday question. How do you define a field to accept
> the value of special register, CURRENT REFRESH AGE?
>
> The friendly SQL reference manual states that it is a DECIMAL(20,6)
> which should translate into PIC 9(14)V9(6) COMP-3. When defined this
> way in a COBOL program the precompiler says
> DSNH312I E DSNHSMUD LINE 445 COL 20 UNDEFINED OR UNUSABLE HOST
> VARIABLE "SR-REFRESH-AGE"
>
> I tried PIC 9(20) COMP-3 and received the same result. I also looked
> in the Applications Programmers Guide and it is barely mentioned this
> special register.
>
> All clues are appreciated.
> --
> David Churn
> Database Architect, DST Systems, Inc.
> President, Heart of America DB2 Users Group
>
>... IDUG advertising deleted...

______________________________________________________________________

* IDUG 2009 Melbourne, Australia * 18-20 March * http://IDUG.ORG/Events *
______________________________________________________________________




IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html