A Cobol program that was converted from DB2/zOS to DB2/Linux is receiving sqlstate 42509. The program uses declared global temp tables. It does not get this sqlstate on DB2/zOS. It's believed this sqlstate is returned when the program tries to issue a drop table statement for a declared global temp table.
Could you check what option you are using for the DYNAMICRULES clause in the bind statement? The bind should have DYNAMICRULES RUN specified, if not, could you rebind with the RUN option and retest the program.
Check out the manual for SQL0549N and the general rules for the DROP statement under Database reference->SQL->Statements.
I see the same restrictions for the DROP statement in the LUW and zOS manuals:
This statement can be embedded in an application program or issued through the use of dynamic SQL statements.
It is an executable statement that can be dynamically prepared only if DYNAMICRULES run behavior is in effect for the package (SQLSTATE 42509).
This statement can be embedded in an application program or issued interactively.
It is an executable statement that can be dynamically prepared only if DYNAMICRULES run behavior is implicitly or explicitly specified.