MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Comparsion using tables

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
sanjayr321
Beginner


Joined: 25 Sep 2006
Posts: 28
Topics: 15

PostPosted: Mon Sep 25, 2006 11:16 am    Post subject: Comparsion using tables Reply with quote

Hai all,

My Input file is having 100000 records with layout EMP NO, Dep NO

Eno Dno

001 A001
001 B001
001 C001
002 D001
003 E001
003 F003
004 G004
005 H002

Each employee may be work under 10 dept maximum.

My requirement is

a) I have to read all the records one by one and all the input record for same ENO are read and store the each DNO in working storage table.

i.e for 001 - A001, B001, C001 have to store in working storage table


Then using the ENO in the input file below query will execute

SELECT DNO, SALARY FROM EMP WHERE ENO = :ENO (from Input file)

It may retrive more than one row.

The selected rows (DNO) must be match with DNO in working storage table on the below condition

a) IF all the rows selected from the query matched with working storage table then perform PARA1

b) IF one of DNO in the working storage table is not match with any of the DNO retrived from query then perform PARA2

c ) IF one of the DNO selected from Query is not match with any of the DNO in the WS-table then perform PARA3


Note : I have to process the record one by one. i.e first i have process 001 for all the condition and then 002 then 003 .....

Thanks....
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Mon Sep 25, 2006 11:37 am    Post subject: Reply with quote

sanjayr321,

1. open the file
2. Read the file
3. Load the file into an internal table until the end of file
4. Close the file
5. Now process each record from the internal table
6. open the cursor
7. Fetch the cursor until sqlcode=100.for each row fetched use SEARCHALL to check if the fetched value matches. Peform the 3 paragraph logic based on the match
8.close the cursor.

Repeat steps 6 thru 8 for all the records in the internal table.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sanjayr321
Beginner


Joined: 25 Sep 2006
Posts: 28
Topics: 15

PostPosted: Tue Sep 26, 2006 12:45 pm    Post subject: Reply with quote

Thanks for reply Kolusu...

Can u give me sample code for comparsion of variables b/w two WS-Tables. Since iam new to this one....
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group