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 Profile Log in to check your private messages Log in
 
Multiple inputs for DB2 Query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Mon Feb 19, 2007 5:19 pm    Post subject: Multiple inputs for DB2 Query
Reply with quote

Hi,
I have 10000 employees to be given as input for the below query..

Eg:Select EMP_NAME,EMP_DEPT from a EMPLOYEE where EMP_NUM in ('00012637','82939939',.......)

Is there a way we can do it thru JCL i.e.input file with a list of employees and make the query take the input from the file..or any other ways..

I need a way other than a cobol pgm..I am a beginner in DB2..

Pls help..

Thanks
Aneeta
Back to top
View user's profile Send private message

prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Mon Feb 19, 2007 5:38 pm    Post subject:
Reply with quote

Aneeta,
Try this JCL

Code:
//DEX007P JOB (0DEX0080),'XCOM JOB',                   
//      CLASS=C,MSGLEVEL=(1,1),                         
//      NOTIFY=DEX007,MSGCLASS=X,REGION=3M             
//STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=20,REGION=0M       
//SYSPUNCH DD DSN=EX.DEX007.SYSPUNCH,DISP=SHR           
//*SYSREC00 DD DSN=EX.DEX007.UNLOAD,DISP=SHR           
//SYSPRINT DD SYSOUT=*                                 
//SYSUDUMP DD SYSOUT=*                                 
//SYSTSPRT DD SYSOUT=*                                 
//SYSTSIN DD  *                                         
   DSN SYSTEM(DB2D)                                     
   RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) -               
   LIB('DB2D.RUNLIB.LOAD')                             
/*                                                     
//SYSIN DD  *

Your query
/*


But in the systsin card give u r db2 sys. name and the plan and program available in your installation.



Thamilzan.
Back to top
View user's profile Send private message
Satish N V Godavarthi

New User


Joined: 23 Feb 2006
Posts: 10
Location: US

PostPosted: Mon Feb 19, 2007 8:07 pm    Post subject: Re: Multiple inputs for DB2 Query
Reply with quote

Aneetha,

I don't think we can dynamically pass values to a query in a JCL.
I only possible way i see through a cobol program and a flat file.


Thanks and bye for now,
GNVS.
There are only 10 people in the world, those who understand computer's and those who don't
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Wed Feb 21, 2007 11:29 am    Post subject: Re: Multiple inputs for DB2 Query
Reply with quote

I don't think we can give dynamic input to a query in a jcl. I think you need to write a code code for the requirment.

Regards,
Jr
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Tue Feb 27, 2007 4:48 pm    Post subject: Re: Multiple inputs for DB2 Query
Reply with quote

I guess using dynamic sql in cobol is the only option.
It will build your querry at run time and then execute.

Thanks,
-Kapil.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 4 Tue Sep 19, 2017 1:39 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am

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