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

Counting duplicates


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

Active User


Joined: 11 Mar 2007
Posts: 199
Location: india

PostPosted: Thu Sep 09, 2010 10:12 am
Reply with quote

Hello,

As per my requrement i need to produce a report displaying the COUNT of duplcate transactions in the input file based on the code and amount.

Input file format:
LRECL = 80 RECFM = VB

Code:
LVPC          150.00
LVPC          150.00
LVPC          150.00
LVPC          150.00
LVPE          100.00
LVPE          125.00
LVPV            2.10
LVPV            7.71
LVPV            7.71
LVPV            7.71
LVPV            8.00
LVPV            8.00
LVPV           10.00



Output file :-
LRECL = 80 RECFM = VB

Code:
code           amount       count
LVPC           150           4
LVPE           100           1
LVPE           125           1
LVPV           2.1           1
LVPV           7.71          3
LVPV           8             2
LVPV           10            1


Thank You,
Rajat
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 199
Location: india

PostPosted: Thu Sep 09, 2010 10:50 am
Reply with quote

Hello,

I sorted this out by using the control card as below:-


Code:
//SYSIN  DD *                             
  OPTION COPY                             
  OUTFIL REMOVECC,NODETAIL,               
  SECTIONS=(5,20,                         
  TRAILER3=(5,21,COUNT=(EDIT=(IIIIIIT))))
/*   


But would definately like to know if there are any other ways of doing it using DFSORT/ICETOOL.

Thank You,
Rajat
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Sep 09, 2010 10:55 am
Reply with quote

Hi,

maybe I'm misunderstanding the question, how do these qualify for duplicates ?
Code:
code           amount       count

LVPE           100           1
LVPE           125           1
LVPV           2.1           1
LVPV           10            1



Gerry
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 199
Location: india

PostPosted: Thu Sep 09, 2010 11:45 am
Reply with quote

Ohh.. its my mistake.. I actaully needed to count of all the records in the input file based on the code and amount.

Thank you,
Rajat
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Sep 09, 2010 6:30 pm
Reply with quote

rajatbagga,
Quote:
But would definately like to know if there are any other ways of doing it using DFSORT/ICETOOL.

Did you try OCCURS Operator?

In your example, you have SECTIONS on 5-20th positions. OCCURS for the same will be as shown below. However, I would still use 2 sections for code and amount since amount can be +ve or -ve(or 2 ON fields if you are using OCCURS).

You may also adjust spacing between 2 report columns using TBETWEEN and few other options.

Code:

//STEP01   EXEC  PGM=ICETOOL                     
//TOOLMSG DD SYSOUT=*                           
//DFSMSG  DD SYSOUT=*                           
//IN      DD DISP=SHR,DSN=YOUR INPUT VB         
//OUT     DD DSN=YOUR OUTPUT VB                 
//TOOLIN DD *                                   
 OCCUR FROM(IN) LIST(OUT) -                     
 HEADER('CODE           AMOUNT') ON(5,20,CH) -   
 HEADER('COUNT')                 ON(VALCNT,N10) 
/*                                               


OUTPUT
Code:

CODE           AMOUNT         COUNT
---------------------   -----------
LVPC          150.00              4
LVPE          100.00              1
LVPE          125.00              1
LVPV            2.10              1
LVPV            7.71              3
LVPV            8.00              2
LVPV           10.00              1


Thanks,
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 How to remove block of duplicates DFSORT/ICETOOL 8
This topic is locked: you cannot edit posts or make replies. Compare files with duplicates in one ... DFSORT/ICETOOL 11
No new posts Merging 2 files but ignore duplicate... DFSORT/ICETOOL 1
No new posts COUNT the number of duplicates DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. SUM FIELDS=NONE in reverse - Get dupl... DFSORT/ICETOOL 9
Search our Forums:

Back to Top