by ceekayrocks » Sat Dec 29, 2012 2:41 pm
Hi Dick / Steve
Thanks for replying,
My plan is to pass a value in a PS file to the WHERE Clause of a Query in A PDS member. I am not sure about the position of the where clause in the query in the member so i need to know how to send this value in the PS file to the Where clause in the query .
I will just give a outline of my requirement as i am not able to share any codes.
//File1 DD DSN = XXXX --------------------------------> (the flat file which has the only the value that i need to pass eg: 128768)
//File2 DD DSN = YYYY(mem1) ------------------------> (the PDS memeber which has the query in which the where clause needs to be changed)
eg of the query in the PDS member:
content Inside FILE2:
select * from table
where salary = 56789 -------------------> This "56789" is to be change to " 128768" from input PS File1.
^^^^^^^^ above is just a sample query , the real time query will be complex but will have only one WHERE clause which needs to be change and its position will be random which we will not be able to know .
Also there are several members of the PDS "YYYYY" like mem2, mem3,.... that have similar queries where the WHERE clause ( same "where salary =") needs to be modified with the same infile FILE1 value "128768".
So My other question will be is there a way to change the member name alone with SET parameter and loop the job? so that i don't have to use too many steps to do the same function of passing a value to the query in different members......
Any suggestions would really guide with the above requirement , thanks all in advance.