maximum length of numeric in cobol

Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

maximum length of numeric in cobol

Postby seiko » Tue Sep 11, 2012 8:26 am

What is the maximum lenght of numeric field that is allowed in COBOL?
What is the picture clause of a 15 digits numeric value having decimal for with commas? without commas?
Is comma included in the account for this S9(4)V99?
Posts: 8
Joined: Fri Aug 31, 2012 8:04 am
Has thanked: 0 time
Been thanked: 0 time

Re: maximum length of numeric in cobol


Re: maximum length of numeric in cobol

Postby BillyBoyo » Tue Sep 11, 2012 8:38 am

The maximum number of digits in a numeric field depends on compiler option ARITH.

In a numeric-edited field, only the digits (the numbers) count towards the maximum.

PIC S9(4)V99 has no comma and no decimal-point.

Now, you need to do a little reading in the Cobol manuals.

You need to understand the difference between numeric and numeric-edited.

You need to be able to find answers to questions like your subject in the manuals.

If there is something you are unclear about, post what you have understood, and your question relating to that. Someone will be here.
Global moderator
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: maximum length of numeric in cobol

Postby Anuj Dhawan » Tue Sep 11, 2012 4:11 pm

...and V is Implied Decimal point in the definition you show.

A rather straight question, I'd like to ask is - why do you worry about the limit (length?) of numeric field? What are you trying to accomplish? If you tell us that, possibly someone will be able to address your question better.
Anuj Dhawan
Posts: 274
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times

Return to IBM Cobol


  • Related topics
    Last post