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
 
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 query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 4 Wed Nov 22, 2017 10:23 pm
No new posts Native SQL Query kishpra DB2 1 Wed Nov 22, 2017 8:38 pm
No new posts Query on IEFBR14 with GDG Ashishpanpaliya JCL & VSAM 4 Tue Nov 07, 2017 8:34 pm

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