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
 

 

Please tell me what should be the query?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Amolondhe007
Warnings : 1

New User


Joined: 16 Apr 2007
Posts: 50
Location: Pune

PostPosted: Wed Jul 11, 2007 3:27 pm    Post subject: Please tell me what should be the query?
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm
No new posts GETMAIN/FREEMAIN query Suja.Sai CICS 9 Tue Jan 31, 2017 12:01 pm


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