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
 

 

DFSORT - Occurance count and write to output

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vijikesavan

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Mon Aug 09, 2010 9:40 pm    Post subject: DFSORT - Occurance count and write to output
Reply with quote

Hi,
I have a input file like this: ID, Desc, Amt
Code:
1111111 ABCDEFGH 100.00
1111111 TSGTWGYW 40.00
1111111 ABCDEFGH 20.00
2222222 TRYUONKP 450.00
2222222 ABCDEFGH 450.00
3333333 ERTGYUER 135.00
4444444 WGJRJYJJ 426.99
4444444 SJRJJEJJ 266.00
1111111 ERTFGYEA 20.00
2222222 TRYUONKP 450.00

Requirement is to have the records from input which has more than 2 occurence of ID (first 7 bytes)

1) I used VALCNT to get the number of occurrences. Worked fine.
Toolin:
Code:
OCCUR FROM(IN1) LIST(TMP1) BLANK HIGHER(2) -
   ON(1,7,CH) ON(VALCNT)                       
  COPY FROM(TMP1) TO(OUT)

Output:
Code:
1(1,7,CH)       VALUE COUNT 
 1111111                  4 
 2222222                  3 


2) Now I need the records of these IDS from the input file. How to get those?
Expected output:
Code:
1111111 ABCDEFGH 100.00
1111111 TSGTWGYW 40.00
1111111 ABCDEFGH 20.00
1111111 ERTFGYEYH 20.00
2222222 TRYUONKP 450.00
2222222 ABCDEFGH 450.00
2222222 TRYUONKP 450.00

Any pointers will be of great help.
Thanks,
Back to top
View user's profile Send private message

sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Mon Aug 09, 2010 10:19 pm    Post subject:
Reply with quote

vijikesavan,

Use SELECT ...

Code:
//S1    EXEC  PGM=ICETOOL                                 
//TOOLMSG DD SYSOUT=*                                     
//DFSMSG  DD SYSOUT=*                                     
//IN      DD *                                             
1111111 ABCDEFGH 100.00                                   
1111111 TSGTWGYW 40.00                                     
1111111 ABCDEFGH 20.00                                     
2222222 TRYUONKP 450.00                                   
2222222 ABCDEFGH 450.00                                   
3333333 ERTGYUER 135.00                                   
4444444 WGJRJYJJ 426.99                                   
4444444 SJRJJEJJ 266.00                                   
1111111 ERTFGYEA 20.00                                     
2222222 TRYUONKP 450.00                                   
//OUT     DD SYSOUT=*                                     
//TOOLIN DD *                                             
 SELECT FROM(IN) TO(OUT) ON(1,07,CH) HIGHER(2)             
/*                                                         


OUTPUT
Code:

1111111 ABCDEFGH 100.00
1111111 TSGTWGYW 40.00 
1111111 ABCDEFGH 20.00 
1111111 ERTFGYEA 20.00 
2222222 TRYUONKP 450.00
2222222 ABCDEFGH 450.00
2222222 TRYUONKP 450.00


Thanks,
Back to top
View user's profile Send private message
vijikesavan

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Mon Aug 09, 2010 10:32 pm    Post subject: Works fine
Reply with quote

Thanks a lot. It worked fine:)
So simple, I cudn't think of it imdlty:)
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
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
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm


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