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
 

 

To Count number of reocrds in a file with key value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: To Count number of reocrds in a file with key value
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

Site Director


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

PostPosted: Tue May 06, 2008 10:49 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue May 06, 2008 11:34 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue May 06, 2008 1:27 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue May 06, 2008 1:42 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue May 06, 2008 1:54 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue May 06, 2008 7:02 pm    Post subject: Reply to: To Count number of reocrds in a file with key valu
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 Moderator


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

PostPosted: Tue May 06, 2008 9:22 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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