Joined: 06 Jun 2008 Posts: 8237 Location: Dubuque, Iowa, USA
If you click on the Manuals link at the top of the page, find the COBOL Language Reference guide, and read section 18.104.22.168 on class conditions you will find
identifier-1 consists entirely of the characters 0 through 9, with or without an operational sign.
If its PICTURE does not contain an operational sign, the identifier being tested is determined to be numeric only if the contents are numeric and an operational sign is not present.
If its PICTURE does contain an operational sign, the identifier being tested is determined to be numeric only if the item is an elementary item, the contents are numeric, and a valid operational sign is present.
Note: Valid operational signs are determined from the setting of the NUMCLS installation option and the NUMPROC compiler option. For more information, see the Enterprise COBOL Programming Guide .
Your variable WS-Y contains somethiing other than digits 0 through 9 and an operational sign -- the decimal point. That prevents it from meeting the NUMERIC class condition.
And if you notice the hex value you posted, it starts X'4E'. Since a zero is X'F0', your IF WS-Y > 0 test will fail as well. COBOL does exactly what you told it to do -- whether or not that is what you meant for it to do.