Accessing function return values in ODBC calls

Specify the function return values for an ODBC call by using the RETURNING phrase of the CALL statement.

CALL "SQLAllocEnv" USING BY VALUE Phenv RETURNING SQL-RC
    IF SQL-RC NOT = SQL-SUCCESS
        THEN
            DISPLAY "SQLAllocEnv failed."
            . . .
        ELSE
            . . .
    END-IF