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

To Count number of reocrds in a file with key value


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Anusha Challa

New User


Joined: 06 May 2008
Posts: 14
Location: Hyderabad

PostPosted: Tue May 06, 2008 9:58 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 06, 2008 10:49 am
Reply with quote

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
View user's profile Send private message
Anusha Challa

New User


Joined: 06 May 2008
Posts: 14
Location: Hyderabad

PostPosted: Tue May 06, 2008 11:08 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 06, 2008 11:34 am
Reply with quote

Hello,

I'm sure that i am misunderstanding something icon_redface.gif

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
View user's profile Send private message
Anusha Challa

New User


Joined: 06 May 2008
Posts: 14
Location: Hyderabad

PostPosted: Tue May 06, 2008 11:57 am
Reply with quote

the key values 4CRRM and 5CRRM are taken from file 1 itself....file 2 is searched with these key values....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 06, 2008 1:27 pm
Reply with quote

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 icon_confused.gif

Also, are the 4 high-lighted characters in the same positons in the records?
Back to top
View user's profile Send private message
Anusha Challa

New User


Joined: 06 May 2008
Posts: 14
Location: Hyderabad

PostPosted: Tue May 06, 2008 1:40 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 06, 2008 1:42 pm
Reply with quote

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
View user's profile Send private message
Anusha Challa

New User


Joined: 06 May 2008
Posts: 14
Location: Hyderabad

PostPosted: Tue May 06, 2008 1:51 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 06, 2008 1:54 pm
Reply with quote

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
View user's profile Send private message
Anusha Challa

New User


Joined: 06 May 2008
Posts: 14
Location: Hyderabad

PostPosted: Tue May 06, 2008 1:59 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 06, 2008 7:02 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 06, 2008 9:22 pm
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top