IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can I declare S9(19) in cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prashant_mq

New User


Joined: 29 Aug 2006
Posts: 24

PostPosted: Tue Jun 10, 2008 9:21 pm
Reply with quote

prashant_mq wrote:
Hi Craq, I'm getting the AR(E) on the listing, could it be the option cannot be overridable?


Sorry I mean I'm NOT getting the AR(E)
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Tue Jun 10, 2008 9:23 pm
Reply with quote

Odd that it shows that the ARITH(EXTEND) option is in effect already.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jun 10, 2008 9:54 pm
Reply with quote

just a hint... long binary up to pic s9(18) are stored as dublewords ( 8 bytes )
I could not find anything on binry with more than 18 digits

number theory
a pic s9(19) will allow a number like 9.999.999.999.999.999.999
and it will definitely not fit in 8 bytes signed

here is a table of 2 powers

Code:

  /09876543210987654321
 1/                   2
 2/                   4
 3/                   8
 4/                  16
 5/                  32
 6/                  64
 7/                 128
 8/                 256
 9/                 512
10/                1024
11/                2048
12/                4096
13/                8192
14/               16384
15/               32768
16/               65536
17/              131072
18/              262144
19/              524288
20/             1048576
21/             2097152
22/             4194304
23/             8388608
24/            16777216
25/            33554432
26/            67108864
27/           134217728
28/           268435456
29/           536870912
30/          1073741824
31/          2147483648
32/          4294967296
33/          8589934592
34/         17179869184
35/         34359738368
36/         68719476736
37/        137438953472
38/        274877906944
39/        549755813888
40/       1099511627776
41/       2199023255552
42/       4398046511104
43/       8796093022208
44/      17592186044416
45/      35184372088832
46/      70368744177664
47/     140737488355328
48/     281474976710656
49/     562949953421312
50/    1125899906842624
51/    2251799813685248
52/    4503599627370496
53/    9007199254740992
54/   18014398509481984
55/   36028797018963968
56/   72057594037927936
57/  144115188075855872
58/  288230376151711744
59/  576460752303423488
60/ 1152921504606846976
61/ 2305843009213693952
62/ 4611686018427387904
63/ 9223372036854775808
64/18446744073709551616


also by looking a bit around seems like pic s9(xx) with xx greater than 18
might work only for not binary

it would be worth trying with an usigned representation
pic 9(19) binary, since in this case it is a binary handle the sign would be irrelevant
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jun 10, 2008 10:03 pm
Reply with quote

just to sum up things, the answer to the O/P ( original post) seems to be,
YES, but not for BINARY

as I said before since the sign is irrelevant I would try with "PIC 9(19)"

but, it would have been nicer on Your side to say from the beginning that
You were also specifying BINARY without us having to click around icon_smile.gif
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jun 10, 2008 11:11 pm
Reply with quote

enrico-sorichetti wrote:
just to sum up things, the answer to the O/P ( original post) seems to be,
YES, but not for BINARY

as I said before since the sign is irrelevant I would try with "PIC 9(19)"

but, it would have been nicer on Your side to say from the beginning that
You were also specifying BINARY without us having to click around icon_smile.gif


I told him that earlier
Quote:
For Enterprise COBOL

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jun 11, 2008 12:03 am
Reply with quote

Hi Craq

I had missed Your quote from the manual ,
repeat things does not hurt anyway

and at the time of Your post the TS had not posted the link to the declaration
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top