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

Multiple inputs for DB2 Query


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts RC query -Time column CA Products 3
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
Search our Forums:

Back to Top