Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i validate input?

Status
Not open for further replies.

frustratedNewbie

Technical User
Nov 24, 2000
1
US
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



Betty Scherber
Brainbench MVP for COBOL II
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top