Joined: 06 Dec 2004 Posts: 211 Location: Keane Inc., Minneapolis USA.
I have a requirement like passing parameters to DB2 query using JCL. I don't want to write a COBOL program for this. But the JCL should read the parameters and pass to SQL statement given in SYSIN DD * of DSNUT1 utility. The production control people will change the parameters alone before running the JCL and they will capture the results into a dataset.
The typical JCL looks like as follows
//STEP1 EXEC PGM=DSNUT1
//SYSIN DD *
SELECT * FROM DEPT WHERE DEPTNO=&Variable;
In above JCL the &Variable should be read from a Physical sequential file. The production control people will change the Physical Sequential file directly and ran the same JCL to get different outputs.
They will use an online program which will write the parameter file. This JCL has to read the file and pass them to the DB2 Query.