JCL to run the DB2 Query - IKJEFT01

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
Kiran V T
Member
Posts: 3
Joined: Sun Apr 11, 2010 10:29 am

JCL to run the DB2 Query - IKJEFT01

Post by Kiran V T » Sun Apr 11, 2010 10:42 am

Hi,

Please help me to get the JCL to run the DB2 query.
I would like to give the query as instream data/input file and needs to get the result in a output file. :?:

Thanks,
Kiran V T[/quote]

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Mon Apr 12, 2010 12:12 pm

You can use IKJEFT01, TSO in batch, to run (get connected with DB2 sub-system) the query.
Regards,
Anuj

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Mon Apr 12, 2010 1:25 pm

You can also look at this for more help.
Regards,
Anuj

Kiran V T
Member
Posts: 3
Joined: Sun Apr 11, 2010 10:29 am

Post by Kiran V T » Mon Apr 12, 2010 5:39 pm

Thanks Anuj,

I have tried IKJEFT01.

//STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DBxx)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2)
END
//SYSIN DD *
Give insteam SQL or Modify to give DSN
/*


But I am getting an Error 'DSNTEp2' not found.

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Mon Apr 12, 2010 6:19 pm

try using STEPLIB.
or better yet, ASK SOMEONE at your site......................
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Kiran V T
Member
Posts: 3
Joined: Sun Apr 11, 2010 10:29 am

Post by Kiran V T » Mon Apr 12, 2010 6:23 pm

Thanks Dick :(

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Mon Apr 12, 2010 8:15 pm

With the information you provide there is very less we can help you with. However, You may try DSNTIAUL as an alternative:

Code: Select all

//STEP010  EXEC PGM=IKJEFT01 
//SYSTSPRT DD SYSOUT=* 
//SYSTSIN  DD * 
 DSN SYSTEM(DB2S) 
 RUN  PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS ('SQL') 
 END 
//SYSPRINT DD SYSOUT=* 
//LISTING  DD SYSOUT=* 
//SYSUDUMP DD SYSOUT=* 
//SYSREC00 DD DSN=...whatever,
//                      DISP=(,CATLG),UNIT=SYSDA 
//SYSPUNCH DD DUMMY 
//SYSIN    DD * 
   Your query here 
/* 
Regards,
Anuj

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Mon Apr 12, 2010 8:39 pm

unfortunately, the plan name for db2 utilities is set by the site.

people should ask their site support/db2 groups
what conventions are used at their site for certain utilities.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Apr 13, 2010 2:30 pm

That's correct Dick and I also vote-in for that thought of yours...
Regards,
Anuj

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others