Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Max Limit for PIC S9(9) USAGE COMP ??

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Max Limit for PIC S9(9) USAGE COMP ??
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: 8218
Location: Dubuque, Iowa, USA

PostPosted: Wed Oct 14, 2009 5:54 pm    Post subject:
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: 6970
Location: porcelain throne

PostPosted: Wed Oct 14, 2009 6:05 pm    Post subject:
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: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed Oct 14, 2009 7:01 pm    Post subject: Reply to: Max Limit for PIC S9(9) USAGE COMP ??
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us