Hi,
How the "coalesce" SQL function is used with COBOL variables? I have to make a "MOVE H-VARS into W-VARS", but H-VARS is obtained with an SQL statement, which can return NULL.
Thanks,
Bye!!
You can't but the SQL you use can do that for you.
But if you are using ESQL or similar and the SQL can return null then you should also be using indicators with your SQL, and you should then test if that indicator flag is true and act upon it.
e.g.
IF MY_FIELD_NULL_INDICATOR = (ON_VALUE)
MOVE ZEROS (OR SPACES) TO MY_FIELD
END-IF.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.