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 Usergroups Profile Log in to check your private messages Log in
 

 

Reading dynamic values from a file inside a control card

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Reading dynamic values from a file inside a control card
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    Post subject:
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    Post subject: Reply to: Reading dynamic values from a file inside a contro
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

Senior Member


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

PostPosted: Wed Aug 10, 2011 6:04 pm    Post subject:
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: 578
Location: USA

PostPosted: Wed Aug 10, 2011 8:03 pm    Post subject:
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    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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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