> i need immediate help regarding handling of numeric field in COBOL85 on
> HP 3000 platform.
This problem is general to all COBOL situations.
> I have a field like 9(12)V9(6). I want to check if the field is numeric
or if it has any
> alphanumeric character. Is there a function call i can use to do a quick
check ?
How about using the IS NUMERIC condition on the field:
01 WS-FIELD PIC 9(12)V9(6).
IF WS-FIELD IS NUMERIC
THEN
save to database.
If that doesn't work, you can try a less elegant approach:
01 WS-FIELD PIC 9(12)V9(6).
01 WS-FIELD-CHAR REDEFINES WS-FIELD
PIC 9(01)
OCCURS 18 TIMES.
Then use a loop to see if each WS-FIELD-CHAR is greater than 0 or less than
9. The problem here is that you may get an error if an alphabetic is in
one of these positions.
So use
01 WS-FIELD-CHAR REDEFINES WS-FIELD
PIC X(01)
OCCURS 18 TIMES.
Then check to see if each WS-FIELD-CHAR is greater than '0' and less than
'9'.
There may be other solutions to this (and I'm sure my fellow posters will
have them). This should get you on the right track, though.
Bill
-------------==== Posted via Sexzilla News ====------------------
http://www.sexzilla.com Search, Read, Post to Usenet
-------------==== With A Whole Lot More ====------------------