If you specify a pointer argument to one of the data types acceptable to ODBC, then you must either pass the target of the pointer BY REFERENCE, define a pointer item that points to the target item and pass that BY VALUE, or pass the ADDRESS OF the target BY VALUE.
To illustrate, assume the function is defined as:
RETCODE SQLSomeFunction(PSomeArgument)
Here PSomeArgument is defined as an argument that points to SomeArgument. You can pass the argument to SQLSomeFunction in one of the following ways:
CALL “SQLSomeFunction” USING BY REFERENCE SomeArgument
You can use USING BY CONTENT SomeArgument instead if SomeArgument is an input argument.
SET PSomeArgument TO ADDRESS OF SomeArgument CALL “SQLSomeFunction” USING BY VALUE PSomeArgument
CALL “SQLSomeFunction” USING BY VALUE ADDRESS OF SomeArgument
You can use the last approach only if the target argument, SomeArgument, is a level-01 item in the LINKAGE SECTION. If so, you can set the addressability to SomeArgument in one of the following ways:
SET ADDRESS OF SomeArgument TO a-pointer-data-item SET ADDRESS OF SomeArgument to ADDRESS OF an-identifier