105 pts.
 Creating JCL to execute a large merged file of SQL for DB2
DB2, JCL, SQL
I need to create a JCL that will execute - individually - SQL statements within a merged file (multiple SQL) and write the SQL results to a single output file. Suggestions?

Software/Hardware used:
ASKED: June 2, 2008  4:55 PM
UPDATED: June 3, 2008  3:06 PM

Answer Wiki:
RUNSQLSTM will run multiple SQL statements
Last Wiki Answer Submitted:  June 2, 2008  8:19 pm  by  graybeard52   3,115 pts.
All Answer Wiki Contributors:  graybeard52   3,115 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Thanks Greybeard52;

That looks like a viable solution to my problem. If I’m reading the WIKI SEARCH on RUNSQLSTM correctly, the length of input file or the number of SQL statements in that file is NOT an issue. COOL! Are there ANY concerns with using RUNSQLSTM w.r.t. the SELECT statement (that you know of) ?

 105 pts.

 

Well, yes.

RUNSQLSTM is designed for batch use, so it cannot return a result set. You can create tables, views, updates, etc. To use SELECT, it must be inserting the records into a table, which is what I think you want to do.

Otherwise, just put a semi-colon at the end of each statement.

 3,115 pts.