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

Maximum number digits in COMP-3


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

New User


Joined: 27 Feb 2004
Posts: 2
Location: chennai

PostPosted: Fri Feb 27, 2004 8:46 pm
Reply with quote

in comp3 what is the maximum number digits that can be decalred like s9(?)comp3[/b]
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Feb 28, 2004 5:28 am
Reply with quote

Hi Fayum,

Ignoring the remainder:

The # of bytes = ? / 2 + 1

For example: # of bytes in S9(5) = 5 / 2 = 2 remainder 1
= 2 +1
= 3

For example: # of bytes in S9(4) = 4 / 2 = 2 remainder 0
= 2 +1
= 3

What this tells us is to use an odd # of 9s in the PIC. It gives you more bang for the byte and its more efficient too.

HTH, Jack.
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1210
Location: India

PostPosted: Sat Feb 28, 2004 9:59 am
Reply with quote

Hai,

Great jack! I will summarize your post...

Quote:
s9(?)comp3


The answer for your ? is 18 in VS COBOL II*
* (It's depending on the compiler)
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Feb 29, 2004 10:14 am
Reply with quote

Oops, looks like I misread the question. icon_redface.gif

Jack
Back to top
View user's profile Send private message
badal_mainframe

New User


Joined: 10 Aug 2004
Posts: 7

PostPosted: Wed Aug 11, 2004 4:14 pm
Reply with quote

COMP-3 CAN BE DEFINED AS 77 A PIC S9(18) COMP-3 BUT IT AGAIN DEPENDS UPON COMPILERS INSTALLATION
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 150
Location: Tokyo, Japan

PostPosted: Wed Aug 11, 2004 7:58 pm
Reply with quote

In addition to Macmillan, if you consider compiler option ARTITH then -
ARITH(compressed) - Default - Max length of numeric item is 18
ARITH(Extend) - Max length of numeric item is 32

Regards,
Sandip.
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

 


Similar Topics
Topic Forum Replies
No new posts Overwriting SSN Digits in Easytrieve ... CA Products 0
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Increase the number of columns in the... IBM Tools 3
Search our Forums:

Back to Top