Joined: 06 Dec 2004 Posts: 211 Location: Keane Inc., Minneapolis USA.
Ans 1: To optimize your program you need to observe and optimize all the SQL queries in your programs. For example if you want to use a small DB2 control table repeatedly in your program then load it into Working storage section. Always try to use Indexed columns in WHERE clause. etc...
Ans 2: We cannot pass parameters directly from JCL to DB2. We will passthem to COBOL+DB2 program, which uses them in queries as host variables. There are 3 methods to pass data from JCL to COBOL
1. Code PARM parameter
2. Use SYSIN DD *
3. PARMLIB Member