Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inputting SELECT predicates using a dataset

Status
Not open for further replies.

dja1

Programmer
Apr 24, 2002
65
GB
Is it possible to do the above in IBM MVs or Z/OS ?
Specifically, I would like to do the following;

SELECT * FROM ANY_TABLE WHERE ANY_COLUMN IN (Parm1, Parm2, etc).

(Or any other construct that would do the required function)

"Parm1", "Parm2" to be contained in an input dataset, as separate records.

Thanks for your attention.
 
Yes, it is. The question is how to get the parameters from an input dataset "into" the subquery.
For example, if the dataset contains three records;
London
Paris
Berlin


How would I code a query that "looked" like
Select * From City_Table where City In ('London', 'Paris', 'Berlin');

In other words, the original SQL would like something like
Select * From City_Table where City In ('Parameter1', 'Parameter2', 'Parameter3');

And the Parameter variables replaced by the contents of the dataset.

Is this possible?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top