|
|
| Author |
Message |
prashant_mq
New User
Joined: 29 Aug 2006 Posts: 24
|
|
|
|
Hi,
Can I declare s9(19) in cobol.
What is the maximum numeric digits allowed.
Whats the alternative to use s9(19).
Thanks |
|
| Back to top |
|
 |
References
|
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1027 Location: Virginia, USA
|
|
|
|
You need to check the manuals for your version of COBOL
For Enterprise COBOL
| Quote: |
| For binary items, the number of digit positions must range from 1 through 18 inclusive. 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. |
|
|
| Back to top |
|
 |
prashant_mq
New User
Joined: 29 Aug 2006 Posts: 24
|
|
|
|
| How do you declare in the JCL? |
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1027 Location: Virginia, USA
|
|
|
|
| You don't declare COBOL Pic's in JCL! |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 9186 Location: 221 B Baker St
|
|
|
|
Hello,
| Quote: |
| Whats the alternative to use s9(19). |
Please explain the content of (or how you will use) a 19 digit number.
Show a few actual values and how they might "decompose".
For example a number like 70355523236784 could be a phone number consisting of the area code (703), the access/exchange code(555), the specific phone (2323) and the "extension" (6784). Is your number a collection of components? |
|
| Back to top |
|
 |
prashant_mq
New User
Joined: 29 Aug 2006 Posts: 24
|
|
|
|
| Craq Giegerich wrote: |
| You don't declare COBOL Pic's in JCL! |
No, I mean how do you declare the ARITH(EXTEND) in JCL? |
|
| Back to top |
|
 |
prashant_mq
New User
Joined: 29 Aug 2006 Posts: 24
|
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 9186 Location: 221 B Baker St
|
|
|
|
Hello,
ARITH(EXTEND) is one of the parms that may be supplied to the compiler. It is usually specified as an override in the execute jcl.
When your compile is submitted, there are most likely parameters supplied in the compile PARM. You would need to add ARITH to those parms.
I'd suggest you talk with whoever supports your standard compiler processes and explain the requirement and they should be able to show you how to do this on your system. |
|
| Back to top |
|
 |
stodolas
Senior Member
Joined: 13 Jun 2007 Posts: 647 Location: Wisconsin
|
|
|
|
| We put it as the very first line in the COBOL source if we need it. Before any IDENTIFICATION or anything else it acts as a precompiler directive. |
|
| Back to top |
|
 |
prashant_mq
New User
Joined: 29 Aug 2006 Posts: 24
|
|
|
|
| dick scherrer wrote: |
Hello,
ARITH(EXTEND) is one of the parms that may be supplied to the compiler. It is usually specified as an override in the execute jcl.
When your compile is submitted, there are most likely parameters supplied in the compile PARM. You would need to add ARITH to those parms.
I'd suggest you talk with whoever supports your standard compiler processes and explain the requirement and they should be able to show you how to do this on your system. |
Hi, Thanks for your help, however I have still getting the "more than 18 bytes " error after I have added the ARITH(EXTEND). Could it be compiler version problem as I'm using Enterprise COBOL 3.4.1 ? |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 9186 Location: 221 B Baker St
|
|
|
|
Hello,
| Quote: |
| Could it be compiler version problem as I'm using Enterprise COBOL 3.4.1 ? |
That version is current.
Please post your jcl/source where you specified arith(extend) as well as the part of the output that shows the compiler optons in effect for your compilation. |
|
| Back to top |
|
 |
stodolas
Senior Member
Joined: 13 Jun 2007 Posts: 647 Location: Wisconsin
|
|
|
|
Here is how we do it. It goes as the first line in the COBOL source.
| Code: |
PROCESS ARITH(EXTEND)
IDENTIFICATION DIVISION.
PROGRAM-ID. MYPROG.
AUTHOR. S STODOLA.
INSTALLATION. MY COMPANY.
DATE-WRITTEN. SEPTEMBER 30, 2005.
|
|
|
| Back to top |
|
 |
prashant_mq
New User
Joined: 29 Aug 2006 Posts: 24
|
|
|
|
| dick scherrer wrote: |
Hello,
| Quote: |
| Could it be compiler version problem as I'm using Enterprise COBOL 3.4.1 ? |
That version is current.
Please post your jcl/source where you specified arith(extend) as well as the part of the output that shows the compiler optons in effect for your compilation. |
Compilation error: IGYDS1505-S: More than 18 digit positions were specified in a "PICTURE" of "S9(18)" was assumed.
The JCL is, you can look at the attachment as well:
//SETPP JOB 30000030000CN,INGM001,CLASS=A,MSGCLASS=Q,
// NOTIFY=INGM001,MSGLEVEL=(0,0),REGION=6M
//********************************************************************
//* *
//* LICENSED MATERIALS - PROPERTY OF IBM *
//* *
//* 5645-001 *
//* (C) COPYRIGHT IBM CORP. 1988, 1997 ALL RIGHTS RESERVED *
//* *
//* US GOVERNMENT USERS RESTRICTED RIGHTS - USE, *
//* DUPLICATION OR DISCLOSURE RESTRICTED BY GSA ADP *
//* SCHEDULE CONTRACT WITH IBM CORP *
//* *
//EDCCPL EXEC IGYWCL,PARM.COBOL='OBJECT,LIB,APOST,LIST',
// PARM.LKED='AMODE=24,RMODE=24'
//COBOL.SYSLIB DD DSN=SYS1.WMQ700.SCSQCOBC,DISP=SHR
//SYSIN DD DSN=INGM001.MQ70.CBLS(SETPROP),DISP=SHR
//LKED.CSQSTUB DD DSN=SYS1.WMQ700.SCSQLOAD,DISP=SHR
//LKED.BSQSTUB DD DSN=INGM001.COBOL.LOAD,DISP=SHR
//LKED.SYSIN DD *
INCLUDE CSQSTUB(CSQBSTUB)
/*
//LKED.SYSLMOD DD DSN=INGM001.COBOL.LOAD(SETPPEXE),DISP=SHR
|
|
| Back to top |
|
 |
prashant_mq
New User
Joined: 29 Aug 2006 Posts: 24
|
|
|
|
| I have tried to put the ARITH(EXTEND) on the PARM.COBOL= in JCL and also PROCESS ARITH(EXTEND) or CBL ARITH(EXTEND) before the IDENTIFICATION DIVISION, however it is still failed. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 9186 Location: 221 B Baker St
|
|
|
|
Hello,
You have posted nothing that shows where you used the extend
Have you tried the method Steve posted? In the code or in the jcl will work so you should check with your organization on which method is proper for your system. Either should get you thru an initial test.
So far, we've seen nothing that would tell the compiler that large numbers were valid. |
|
| Back to top |
|
 |
|
|