Can we pass DB2 host variables to a subprogram if so how
You dont't have to pass the variables , but the values in the variables.
You receive the values in some ws variable of your subprogram and use it into the the queries.
Or you can include the DCLGEN of the table in your subprogram and use the host variables as per your need.
Some one would be able to suggest concrete ways to achieve your requirement if you can elaborate a little more.