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

Reading dynamic values from a file inside a control card


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
byasmeen

New User


Joined: 01 Mar 2010
Posts: 15
Location: chennai

PostPosted: Wed Aug 10, 2011 4:12 pm
Reply with quote

Hi,

I have the following requirement.

I have query in control card say

select * from table where columnname in (a,b,c)

the values specified in the where condition will be generated dynamically and sent to us through a PS file.
We need to read the values from this file inside the control card.

Can you provide me some pointers on how to proceed on it.

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 10, 2011 4:51 pm
Reply with quote

Start here Redbook: Dynamic SQL
Back to top
View user's profile Send private message
Soumik Das

New User


Joined: 06 Aug 2011
Posts: 25
Location: India

PostPosted: Wed Aug 10, 2011 4:59 pm
Reply with quote

One question first.

How will you generate the parameters or the values dynamically? are you using any programs for that?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Wed Aug 10, 2011 6:04 pm
Reply with quote

I'm not very sure that it can be directly done using SQL/ DB2 on zOS; however, you might consider a SORT solution in which you can create a "control card (as you called it)" which will have the query, which can later be used in DB2-step.

There are some examples in these forums, search for SYMNAMES in DFSort part of the Forum.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Aug 10, 2011 8:03 pm
Reply with quote

byasmeen,
Are you looking for something like below?
Code:
//SYSIN    DD  DISP=SHR,DSN=FILE WITH SELECT STATEMENT  --> (i.e. SELECT * FROM TABLE WHERE COLUMNNAME IN )
//         DD  DISP=SHR,DSN=FILE WITH VALUES


Thanks,
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top