Posted: Tue Sep 07, 2004 1:26 am Post subject: Executing SQL queries thru JCL
Hi,
Any idea on how to execute SQL queries thru JCL? Any sample JCL would do.
I'm using the following JCL and executing the same using a utility program IKJEFT1B the source code of which I can't browse.
The control card GLSRPTA2 contains all SQL queries in the same way as we give in SPUFI.The SYSPRINT DSN contains result of the queries.
Now the prob I'm facing here is even though i create SYSPRINT DSN of LRECL =155, it gets created as 133 FB. We're not passsing any parameter to the program.
Any idea why is it doing so?
Thanks in advance. _________________ Regards,
Mangsk
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Tue Sep 07, 2004 5:02 am Post subject:
mangsk,
The default output file LRECL of DSNTEP2 is 133. You CANNOT override that. Instead you can DSNUTILB which is a sample unload utility. Check this link for a detailed explanation of the utility
Thanks Kolusu.
Now the question here is about using DSNTIAUL. In this utility,can we have more than 1 SQL statements in SYSIN data and get the output in only one output file?
The examples on this page show 2-3 SQL statements and their outputs will go into 2-3 different files.
Thanks! _________________ Regards,
Mangsk
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Tue Sep 07, 2004 8:25 am Post subject:
Mangsk,
Yes the output of each sql statement is sent to a seperate dataset. If you want it in a single file , then you need to pre-allocate the output dataset and code DISP=MOD in the unload step. However make sure that your output file has the maximum lrecl from all your queries.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum