View previous topic :: View next topic
|
Author |
Message |
Anusha Challa
New User
Joined: 06 May 2008 Posts: 14 Location: Hyderabad
|
|
|
|
Two input data sets,one with all the key values and the other contains the records to be searched.The second file contains number of records for one key value.The requirement is to get the count of records presented in the second file with the key value. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Anusha Challa and welcome to the forums,
Quote: |
Two input data sets,one with all the key values and the other contains the records to be searched. |
I believe i understand the first sentence of your request.
Quote: |
The second file contains number of records for one key value.The requirement is to get the count of records presented in the second file with the key value. |
This, i do not understand.
Please show a small amount of input from the 2 files and the output you want from processing this input. Also, please mention the recfm and lrecl of the 3 files and signifiicant positions within the files. You do not need to show entire records - just enough to demonstrate your requirement. |
|
Back to top |
|
|
Anusha Challa
New User
Joined: 06 May 2008 Posts: 14 Location: Hyderabad
|
|
|
|
thanks for the response,
First input dataset:(record length =428)
3J 3174 4crrm W7C 7313729 08113 1116 UH65 406 20 00 42 42 0
3J 3174 5crrm RGG 0349700 08113 1116 UH65 406 20 00 33 33 0
second input dataset:(recrd length =174)
Ê O°DY %4CRRMI j %4CRRM øëð øëð00M7S730HQ12291 X
Ê P DY %4CRRMIÀ x %4CRRM øëð øëð00M7S730HQ12291 X
Ê P\DY %4CRRM p %4CRRM øëð øëð00M7S730996156748X
Ê O°DY %5crrmI j %5crrm øëð øëð00M7S730HQ12291 X
Ê P DY %5crrmIÀ x %5crrm øëð øëð00M7S730HQ12291 X
Ê QhDY %4CRRMô Ú %4CRRM øëð øëð00M7S730996156748X
Ê R DY %4CRRMò _ %4CRRM øëð øëð00M7S740996156748X
Ê RQDY %4CRRMòÄ æ %4CRRM øëð øëð00M7S740996156748X
Ê R DY %5crrmò _ %5crrm øëð øëð00M7S740996156748X
Required Output :
Number of records for Key 4CRRM in second datset is 6
Number of records for Key 5CRRM in second datset is 3 |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I'm sure that i am misunderstanding something
What is file 1 used for? It appears that file 2 could be read and the counts gotten from only the file 2 data? |
|
Back to top |
|
|
Anusha Challa
New User
Joined: 06 May 2008 Posts: 14 Location: Hyderabad
|
|
|
|
the key values 4CRRM and 5CRRM are taken from file 1 itself....file 2 is searched with these key values.... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
file 2 is searched with these key values.... |
Why? All of the records in file 2 are being used in the counts.
Unless you haven't explained the complete "rules", i see no need to read file 1
Also, are the 4 high-lighted characters in the same positons in the records? |
|
Back to top |
|
|
Anusha Challa
New User
Joined: 06 May 2008 Posts: 14 Location: Hyderabad
|
|
|
|
Thanks for the response vasanth.just for example i gave 2 values in 1st file.....but exactly first file consists of many number of reords around 7k.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
but exactly first file consists of many number of reords around 7k..
|
It doesn't matter how many records are in file 1 if all of the records in file 2 are to be counted. |
|
Back to top |
|
|
Anusha Challa
New User
Joined: 06 May 2008 Posts: 14 Location: Hyderabad
|
|
|
|
dick,you are not getting my point......as i showed you,for 4crrm there are 6 records in file2,for 5crrm there are 3 records in file2....similarly for the rest of 7k key values in file1,there are some number of records in file2....i want the number of records for all the key values....not just for 1 or 2. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
you are not getting my point...... |
Sorry, but it is you who is not getting the point. If all of the records in file 2 are to be counted, file 1 is not needed.
So, are all of the records in file 2 to be counted? |
|
Back to top |
|
|
Anusha Challa
New User
Joined: 06 May 2008 Posts: 14 Location: Hyderabad
|
|
|
|
only the records in file2 with key value from file1 need to be counted....Suppose there are x records in file1 and and for each record in file1 there will be some y records (y1,y2,y3.........yx) in file2....i need the values of y1,y2,y3....yx....... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
only the records in file2 with key value from file1 need to be counted.... |
Ah, the piece i was missing.
Thank you.
d |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Anusha,
What is the starting position, length and format for the key in input file1?
What is the starting position, length and format for the key in input file2?
What is the approx. maximum number of records in input file1 (10, 1000, 10000, etc?).
Are the keys really mixed uppercase and lowercase characters? If so, are 5crrm and 5CRRM a match? |
|
Back to top |
|
|
|