Hi all. I'm receiving the following error in my joblog numerous times and it appears, according to the message, that the select is returning a null value to the host variable (TTLOH), right? If it is possible that no value is returned, is there a way to bypass the error? I'm not exactly sure what is meant by the "descriptor area", or if that's something that I need to create or change.
Here's the error:
CAUSE . . . . . : A FETCH, EMBEDDED SELECT, CALL, GET DESCRIPTOR, OR A SET
OR VALUES INTO STATEMENT HAS RESULTED IN A NULL VALUE, BUT AN INDICATOR
VARIABLE WAS NOT SPECIFIED FOR HOST VARIABLE TTLOH. THE RELATIVE POSITION
OF THE HOST VARIABLE IN THE INTO CLAUSE OR PARAMETER LIST IS 6. IF THE HOST
VARIABLE NAME IS *N, A DESCRIPTOR AREA WAS SPECIFIED. IF THIS ERROR OCCURS
ON A GET DESCRIPTOR STATEMENT, THE NULL VALUE IS BEING RETURNED BUT THE
INDICATOR ITEM WAS NOT SPECIFIED ON THE GET DESCRIPTOR STATEMENT. RECOVERY
. . . : SPECIFY AN INDICATOR VARIABLE, AND PRECOMPILE THE PROGRAM AGAIN.
IF THIS IS A GET DESCRIPTOR STATEMENT, SPECIFY BOTH THE DATA ITEM AND THE
INDICATOR ITEM. PRECOMPILE THE PROGRAM AGAIN.
And here's the SQL statement:
C+ SELECT sum(A.ISHAND) into :TTLOH FROM INSBAL A WHERE
C+ A.ISTORE = :STRNUM AND A.IDEPT = :IDEPT AND A.ISDEPT = :ISDEPT
C+ AND A.ICLAS = :ICLAS AND A.ISCLAS = :ISCLAS AND A.ISHAND > 0