Numeric empty function
To test if a numeric variable is either empty or contains zero when the BLANK WHEN ZERO clause is set on the variable, the function NUMERIC-EMPTY can be called.
This function can only be used in the FORM-TO-WS or WS-TO-FORM logic of a CobolForm.
The NUMERIC-EMPTY function expects a CobolForm field as input parameter and returns the Boolean value TRUE if the field value is empty.
The syntax for this function is as follows:
FUNCTION NUMERIC-EMPTY(<FieldName>)
Parameter | Description |
<FieldName> | The name of a numeric form field with the BLANK WHEN ZERO clause set. |
Example:
PROCEDURE DIVISION.
WS-TO-FORM SECTION.
INIT-WS-TO-FORM.
MOVE ZERO TO FORM-STATUS.
IF NOT FORM-ERROR
IF FUNCTION NUMERIC-EMPTY(ILS-MONTHS-FLD)
DISPLAY 'FIELD REQUIRED'
MOVE 1 TO FORM-STATUS
END-IF
END-IF.
EXIT-WS-TO-FORM-END.
...