I have to create a exract file from a SQL query. I want it to run through DSTAIUL utility. But there is a complex situation. Some of the column values need to be changed dynamically.
Is it possible to pass values of those columns through some way still using DSNTAIUL or I have to write a cobol program which will take those parameter and run the query through the program?
Joined: 04 Oct 2010 Posts: 19 Location: Land of broken dreams
Your requirement is really vague. But still I'll try to answer
You can give your input query in the SYSIN of the DSNTIAUL but the term dynamic is very confusing here. Does it mean that you have to unload the table in a different way according to any business logic? In that case, its best to write a Cobol program and fetch only those columns that you want from the DB2 table and write in a file.
Is it what you expect??
My Sql query is like this :-
Select A.product_no, b.product_group_type
From ABC A,BCD B,CDE C, DEF D, EFG E
Where A.Product_type = 45 and B.Eff_date > '01.01.2008' and E.Supplier_no >900000
There are a lot more conditions included in where clause.. My concern is to pass these hard coded values in where clause dynamically.
Is it possible to use DSNTAUIL utility by using some means to pass these value dynamically.
Or writing a program is the only option ?