Could you please advise what's the better way when 'moving alphanumeric character to numeric value ' ?
One way: determine if the alphanumeric just only contains numeric value.
Cobol sentence: IF WORK-PM IS NUMERIC then ...
Another way: use NUMVAL function(A question, is there any other Function? )
Cobol sentence: COMPUTE WORK-PM = FUNCTION NUMVAL(WORK-AM) then...
What's the better way and is there any other better function than NUMVAL ?
Joined: 20 Oct 2006 Posts: 6962 Location: porcelain throne
If your source field only contains 0-9 and/or valid sign, the IF NUMERIC will work. But if your source field contains an edited numeric value (leading or trailing spaces, the IF NUMERIC will fail; if you need to extract valid numeric data from an alpha-numeric field, you have to use NUMVAL or NUMVAL-C