View previous topic :: View next topic
|
Author |
Message |
Sudeshna Sarkar
New User
Joined: 11 Sep 2008 Posts: 29 Location: Kolkata
|
|
|
|
Hi,
I was asked a question as to, a COMP-3 variable stores 18 digits using 10 bytes , i.e. S9(18).
Now the requirement changes and I am supposed to store S9(20), consider there is an increment in the length of the field. In this case what are the changes that I need to make? Rather, which storage will be best for S9(20)?
I had absolutely no idea, I have also searched across forums, but could not get any answer. Any help is appreiciated!
TIA.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
At the top of the page is a link to "IBM Manuals". The top set is for COBOL.
Suggest you look at the Language Reference for your version of cobol and read about numeric fields and their capacity. If you find something in the documentation that is not clear, post what you found and your doubt. Someone here will be able to clarify. |
|
Back to top |
|
|
Sudeshna Sarkar
New User
Joined: 11 Sep 2008 Posts: 29 Location: Kolkata
|
|
|
|
From what I have read and understood till now, is that the COMP usages can handle fields with size till S9(18), that is COMP-3 can store max 18 digits using 10 bytes.
After this if we have more digits like S9(20), then I think we better not use COMP-3 or any other COMP any more, just go for simple numeric declaration.
Please correct me if I am wrong!
|
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Pay particular attention to the ARITH(EXTEND) compiler option in the USAGE clause section of the manual. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
What version/release of COBOL are you using?
If you're not sure, does your compiler support option ARITH(EXTEND)?
Note for 9(18) COMP-3, the high-order 4-bit nibble of the first byte is not addressable.
Bill |
|
Back to top |
|
|
sun_job
New User
Joined: 18 Sep 2007 Posts: 73 Location: Bangalore
|
|
|
|
Hi,
COMP-3 can store upto S9(31), ie 15 bytes , if compiler option ARITH(EXTEND) is enabled.
Sun |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Don't you mean 16 bytes? |
|
Back to top |
|
|
Sudeshna Sarkar
New User
Joined: 11 Sep 2008 Posts: 29 Location: Kolkata
|
|
|
|
Hi,
@ Bill: Sorry for the delayed reply. Yes well in our ZOS, we are hosting both COBOL 85 as we as Enterprise COBOL.
As I read from the manuals, the option ARITH(EXTEND) thereby supporting more than 18 digits of storage of COMP-3 variables, is permissible only on Enterprise COBOL.
So ideally for storing data of more capacity, Enterprise COBOL must be used and moreover system must support compiler option ARITH(EXTEND). Will try this out soon and let you know my results.
Thanks again. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
we are hosting both COBOL 85 |
Post the compiler release shown in the beginning of the complier output.
COBOL 85 is a standard, not a version of the compiler. . .
Unless i missed a memo. . . |
|
Back to top |
|
|
|