IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Jcl to run sql query which is in PS file


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 1287
Location: Chennai, India

PostPosted: Fri Nov 14, 2008 4:39 pm
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
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
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: 1287
Location: Chennai, India

PostPosted: Fri Nov 14, 2008 5:31 pm
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

Superior Member


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

PostPosted: Sat Nov 15, 2008 12:27 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top