I have a similar kind of problem. I have 59 tables all first qualifier of all the 59 tables differ. I have a JCL that has 59 steps each step executing a query present in SYSIN. Before each step, i wanted to chane the variable QUALIFIER. Is there a way of doing this??? Please suggest.

Create a program that accepts the value of &QUALIFIER via a parameter. The program should then resolve that parameter to it's assigned value, and then create the required output with the properly resolved value.

The bigger issue for you is, with 59 steps, how do you intend to go about specifying the value for &QUALIFIER between all the steps, keeping the constructs and constraints of JCL processing in mind?

Then there would be 59 executes for the proc with a different qualifier for each run.

As Kevin mentioned, you could also create these "on the fly". If you do this on the file, i'd suggest a file that contains the quailfiers be read into your pgm and generate the needed statements for the executions.

1.Create a JCL that calls a REXX
2. There will be only one control card that rexx opens and changes the qualifier inside it. Basically rexx reads all the qualifiers from a dataset and puts in an array and a loop is run n ( n = number of elements read from the dataset) numer of times. Inside the loop rexx changes the control card and submits a job which uses the changed control card everytime.

Here i am posting the REXX part inside the loop for the benifit of others.
Please let me know if this can be done in a better way.