Page 1 of 1

ZERO SYNTAX IN COBOL

PostPosted: Wed May 11, 2016 7:07 pm
by arya_starc
What is the difference between zero, zeros and zeroes and when to use which one in cobol program

Re: ZERO SYNTAX IN COBOL

PostPosted: Wed May 11, 2016 7:25 pm
by Robert Sample
And what did the manual tell you when you read it?

Re: ZERO SYNTAX IN COBOL

PostPosted: Wed May 11, 2016 7:28 pm
by Aki88
Hello,

The best place to look at for such queries is the COBOL manual.
From the good old Language Reference:

ZERO, ZEROS, ZEROES
Represents the numeric value zero (0) or one or more occurrences of the
character zero, depending on context.
When the figurative constant ZERO, ZEROS, or ZEROES is used in a
context that requires an alphanumeric character, an alphanumeric character
zero is used. When the context requires a national character zero, a
national character zero is used (value NX'0030'). When the context cannot
be determined, an alphanumeric character zero is used.

---
---
Alternative spellings ZEROS and ZEROES for ZERO
---
---


Which is clear enough in itself.

Edit: My bad Robert; didn't see you'd already replied to the post. :oops: