Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us