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

Max Limit for PIC S9(9) USAGE COMP ??


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

New User


Joined: 17 Nov 2008
Posts: 4
Location: United states

PostPosted: Wed Oct 14, 2009 5:38 pm
Reply with quote

could some one pls tell me what would be the max limit that can be stored in a variable defined as PIC S9(9) USAGE COMP

please explain also how you calculated .

TIA
Mave
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Oct 14, 2009 5:54 pm
Reply with quote

Either 999,999,999 or 2,147,483,647 -- the actual maximum depends on a compiler option. TRUNC(BIN) allows the binary value maximum of 2 to the 31st power minus 1 while TRUNC(STD) allows the picture size to determine the maximum. TRUNC(OPT) is the other option and in that case, the actual value may not be determined in advance.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Oct 14, 2009 6:05 pm
Reply with quote

Regardless of the setting of the TRUNC compiler option, COMP-5 data items behave like binary data does in programs compiled with TRUNC(BIN).
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Oct 14, 2009 7:01 pm
Reply with quote

Adding to Dick's response, unless you absolutely need a sign, unsigned COMP-5 (Native Binary) 9(09) has a maximum value of 4,294,967,295.

COMP-5 was introduced with OS390/COBOL version 2.2 about 10 years ago.

Bill
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 COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts STEM usage in REXX CLIST & REXX 14
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts z/OS Modules Usage report using SMF 42 DFSORT/ICETOOL 2
No new posts Expand ISPF field up to a limit - is ... TSO/ISPF 9
Search our Forums:

Back to Top