You can specify the DB2 Compiler directive anywhere where you can specify any other Compiler directive. For example:
$set db2(init=prot bind collection=myschema)
cob -Vt testconn.cbl -C"anim db2(init==prot bind collection==myschema)"