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 Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm


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