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

Please tell me what should be the query?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Amolondhe007
Warnings : 1

New User


Joined: 16 Apr 2007
Posts: 49
Location: Pune

PostPosted: Wed Jul 11, 2007 3:27 pm
Reply with quote

I have 100 account numbers in a PS(flat file ). I have to check weather the account numbers are exist in the database or not.
Can we check in the database by executing a single Query in SPUFI flat file as input.
If yes what will be the Query?
Back to top
View user's profile Send private message
sandeep1dimri

New User


Joined: 30 Oct 2006
Posts: 76

PostPosted: Wed Jul 11, 2007 3:43 pm
Reply with quote

I never got solution to this mannual job icon_cry.gif
Back to top
View user's profile Send private message
priyamnavada

New User


Joined: 24 Dec 2005
Posts: 52
Location: hyderabad

PostPosted: Wed Jul 11, 2007 4:47 pm
Reply with quote

while running a query in SPUFI, we cant access flat file as input. Either the values should b specififed in the query or else through COBOL+DB2 program you can check it out.
Back to top
View user's profile Send private message
a027412

New User


Joined: 05 Jul 2007
Posts: 40
Location: Minneapolis, MN

PostPosted: Wed Jul 11, 2007 6:04 pm
Reply with quote

Hi, you can try this option.
Code:
//STEP010 EXEC DB2TBTLO,UTILITY=DSNTEP2                 
//SYSUDUMP DD   SYSOUT=*                               
//ABNLIGNR DD DUMMY                                     
//SYSIMAG  DD DUMMY                                     
//SYSPRINT DD SYSOUT=*                                 
//SYSCTL   DD DUMMY                                     
//SYSIN   DD  *                                         
 SELECT * FROM OWNER.TABLE                             
   WHERE  account_num IN (                                           
//         DD DSN=FLAT.FILE.CONTAIN.ACC.NUMBER,DISP=SHR
/*           

Edit the dataset FLAT.FILE.CONTAIN.ACC.NUMBER containing the account number by
1:inserting commas in between two account numbers
2:end the flat file with
Code:
);
Back to top
View user's profile Send private message
wanderer

Active User


Joined: 05 Feb 2007
Posts: 199
Location: Sri Lanka

PostPosted: Wed Jul 11, 2007 10:58 pm
Reply with quote

a027412 wrote:
Hi, you can try this option.
Code:
//STEP010 EXEC DB2TBTLO,UTILITY=DSNTEP2                 
//SYSUDUMP DD   SYSOUT=*                               
//ABNLIGNR DD DUMMY                                     
//SYSIMAG  DD DUMMY                                     
//SYSPRINT DD SYSOUT=*                                 
//SYSCTL   DD DUMMY                                     
//SYSIN   DD  *                                         
 SELECT * FROM OWNER.TABLE                             
   WHERE  account_num IN (                                           
//         DD DSN=FLAT.FILE.CONTAIN.ACC.NUMBER,DISP=SHR
/*           

Edit the dataset FLAT.FILE.CONTAIN.ACC.NUMBER containing the account number by
1:inserting commas in between two account numbers
2:end the flat file with
Code:
);


I don't think there is anything like this in the manual or I haven't seen yet. They did try an example based on a user defined function but nothing like this. But this thing works! Thanks a027412 for sharing. icon_biggrin.gif
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top