Page 1 of 1

Handle Abend for intrensic functions

PostPosted: Wed Mar 08, 2017 5:26 pm
by cvvishu
Hi ,
Is there a way to avoid hard termination of the program in case of a failure in cobol intrinsic function.

Example , i am trying to use NUMVAL function to validate the given PIC (X) field and move it to a numeric field . But if the given data is alphanumeric , i do not want my program to amend , rather i need to move a default value and continue with my next record. Is this achievable ?

Re: Handle Abend for intrensic functions

PostPosted: Wed Mar 08, 2017 9:09 pm
by Robert Sample
There is nothing in COBOL to do what you want. You might be able to achieve this through the LE interface, but you'll have to do the research to determine whether or not it can.

You might find it easier to scan the variable to pass to NUMVAL, looking for any invalid characters before using NUMVAL (the ease of this approach would depend upon how complex your NUMVAL variable gets).

Re: Handle Abend for intrensic functions

PostPosted: Wed Mar 08, 2017 9:15 pm
by BillyBoyo
Post some representative examples of what you want to convert. NUMVAL/NUMVAL-C aren't much use unless your data is good.

Re: Handle Abend for intrensic functions

PostPosted: Thu Mar 09, 2017 8:10 pm
by Terry Heinze
Many, if not all, of COBOL's intrinsic functions do not validate input.