Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

COBOL Programming :: RE: Validate if a Value from the file is numeric

$
0
0
Author: Robert Sample
Subject: Reply to: Validate if a Value from the file is numeric
Posted: Tue Jun 20, 2017 12:39 am (GMT 5.5)

From the Enterprise COBOL Language Reference manual, page 210 (V6.1):
Quote:
For all numeric fields, the PICTURE character-string can contain only the symbols 9, P, S, and V.
Decimal points are not considered numeric characters, although signs are. You can check each character to be what you want or you can try using FUNCTION NUMVAL to convert the data to a numeric variable (which may cause problems if you have true non-numeric data in the variable).
_________________
TANSTAAFL

The first rule of code reuse is that the code needs to be worth re-using.

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth


Viewing all articles
Browse latest Browse all 8500

Trending Articles