Your query spawns multiple aspects
1. how is CICS initiating a DB2 connection
2. accessing DB2 data using SQL queries from a CICS defined transaction
3. compiling and linking of a program utilizing SQL commands in CICS env
Please specify which of the above you need help on.