Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Jcl to run sql query which is in PS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
pradeep_123

New User


Joined: 21 Nov 2007
Posts: 9
Location: bhubaneswar

PostPosted: Fri Nov 14, 2008 4:27 pm    Post subject: Jcl to run sql query which is in PS file
Reply with quote

Can I use Jcl to run sql query which is in PS file by using Parm parameters?
Back to top
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Nov 14, 2008 4:39 pm    Post subject: Reply to: About DB2 query
Reply with quote

Hi,

Quote:
Can I use Jcl to run sql query which is in PS file by using Parm parameters?


Hopefully YES. I have not tried it but remember seeing few UNLOAD JCL's with a SQL query.
Back to top
View user's profile Send private message
pradeep_123

New User


Joined: 21 Nov 2007
Posts: 9
Location: bhubaneswar

PostPosted: Fri Nov 14, 2008 4:45 pm    Post subject: Reply to: About DB2 query
Reply with quote

can u provide any information regarding how it will connect to DB?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Nov 14, 2008 5:29 pm    Post subject:
Reply with quote

below is sample jcl

Code:

//STEP001 EXEC PGM=IKJEFT1B,                           
//             REGION=18M,TIME=1400                     
//SYSTSPRT DD  SYSOUT=*                                 
//SYSTSIN  DD  *                                       
 DSN SYSTEM(DB2D)                                       
 RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL') -   
 LIB('db2.load.library')                               
/*                                                     
//SYSPRINT DD  SYSOUT=*                                 
//SYSIN DD  *                                           
sql query here
/*                                                     
//SYSPUNCH DD  DUMMY                                   
//SYSREC00 DD  DISP=SHR,                               
//             DSN=dsnname,             
//             SPACE=(TRK,(750,75),RLSE)               
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Nov 14, 2008 5:31 pm    Post subject: Reply to: Jcl to run sql query which is in PS file
Reply with quote

Pradeep,

Quote:
Can I use Jcl to run sql query which is in PS file by using Parm parameters?


You can give the PS name containing the SQL query across SYSIN in the JCL provided by Sambhaji.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sat Nov 15, 2008 12:27 am    Post subject: Re: Jcl to run sql query which is in PS file
Reply with quote

Hi,
pradeep_123 wrote:
Can I use Jcl to run sql query which is in PS file by using Parm parameters?
What parameters you are asking about here, please clarify. BTW, if your query is in PS file (QSAM), you could use SPUFI as well.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Nov 17, 2008 2:36 pm    Post subject:
Reply with quote

You can run SPUFI in batch mode using DSNTEP2 too
Code:

//STEP001 EXEC PGM=IKJEFT01,DYNAMNBR=20,         
//             REGION=4M
//SYSTSPRT DD  SYSOUT=*                           
//SYSTSIN  DD  *                                 
 DSN SYSTEM(DB2D)                                 
 RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) -             
 LIB('db2.load.library')                         
/*                                               
//SYSPRINT DD  SYSOUT=*                           
//SYSIN DD  *                                     
   your query here 
/*                                               
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 4 Wed Nov 22, 2017 10:23 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us