Compiling and linking a PL/I stored procedure using DB2 LUW is a bit different than compiling and linking most PL/I applications. Use this procedure to compile and link DB2 stored procedures under DB2 LUW.
mfplx -sql db2 -optsql DB=SAMPLE getprml.pli -nolaxdcl –ppsql -c
UNIX:
To link the stored procedure, you must build the module using cob, ensuring that the resultant module has no file extension.
On AIX platforms, you should use the following command to build the stored procedure as an executable :
cob -x GETPRML.o -e GETPRML -L$COBDIR/lib -lmfpliz -lplidump
On other UNIX platforms, you should use the following command format to build the stored procedure as a self-contained Callable Shared Object :
cob -y GETPRML.o -o GETPRML -e GETPRML $COBDIR/lib/32/dllmain_cob.o -L$COBDIR/lib -lmfpliz -lplidump
Copy the stored procedure object that is produced to the function directory under your DB2 instance.
Execute db2stop, copy the DLL, then execute db2start from a DB2 administrative command prompt.
Execute the following command from a DB2 command prompt:
db2 update dbm cfg using KEEPFENCED NO
Executing this command in a production environment has a significant performance impact, so it should not be used. Refer to your IBM documentation for more information on this command.