I'd like to know how to validate fields for such things as no data at all, or a field must exist, if a field should be numeric or alphanumeric... how can i do this? thanks
There is no such thing as a "Null" field in COBOL like there is in some other languages. A field with "no data" might be SPACES, LOW-VALUES, or ZEROS. To test for spaces you merely have to say:
IF FIELD-A = SPACES
The tests for LOW-VALUES and ZEROS are the same.
To perform a numeric or alphabetic test, just use:
IF FIELD-A IS NUMERIC or IF FIELD-A IS ALPHABETIC
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.