Question

  Asked: Jun 2 2008   4:55 PM GMT
  Asked by: Jonty Walker


Creating JCL to execute a large merged file of SQL for DB2


SQL, DB2, JCL

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?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0



RUNSQLSTM will run multiple SQL statements
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Development, Database and DataCenter.

Looking for relevant Development Whitepapers? Visit the SearchWinDevelopment.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Jonty Walker  |   Jun 3 2008  2:32PM GMT

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) ?

 

Graybeard52  |   Jun 3 2008  3:06PM GMT

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.