Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
File processing with Maximun count as a field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
dharmendra.rawat84

New User


Joined: 26 Oct 2010
Posts: 1
Location: Hyderabad

PostPosted: Wed Dec 01, 2010 8:59 pm    Post subject: File processing with Maximun count as a field
Reply with quote

Hi,

I have a file having records like this mentioned below.

SYS-ID PROV-ID COUNT

111111 3333333 10
111111 4444444 20
111111 5555555 15
222222 6666666 10
222222 7777777 20
222222 8888888 15

I have a requirement like I want the out file to be as below.
I want the records in output file that has max count.

SYS-ID PROV-ID COUNT

111111 4444444 20
222222 7777777 20

Please give me some suggestions...

Regards,

Dharam
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Wed Dec 01, 2010 9:17 pm    Post subject:
Reply with quote

if you know what the value of the max-count is, no problem
otherwise, sort the file prior to reading (max-count Desc).
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Thu Dec 02, 2010 7:13 pm    Post subject:
Reply with quote

Or to put it more complete:

Sort on keys ASCENDING SYS-ID PROV-ID, DESCENDING COUNT and subsequently process the first record in each break of the key SYS-ID PROV-ID, and discard the rest.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Thu Dec 02, 2010 8:24 pm    Post subject:
Reply with quote

actually, you definition of the problem is confusing.

what are the actual control breaks?

is the highest count the highest of the file?
will every sys-id have a record (regardless of prov-id)
that contains this high-count.
or do you want the sys-id/prov-id/count for every sys-id?
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts ISMF Difference between volume count ... upendrasri IBM Tools 2 Tue Dec 05, 2017 12:40 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us