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
 
Counting duplicates

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

Active User


Joined: 11 Mar 2007
Posts: 193
Location: india

PostPosted: Thu Sep 09, 2010 10:12 am    Post subject: Counting duplicates
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: 193
Location: india

PostPosted: Thu Sep 09, 2010 10:50 am    Post subject:
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: 1703
Location: Australia

PostPosted: Thu Sep 09, 2010 10:55 am    Post subject:
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: 193
Location: india

PostPosted: Thu Sep 09, 2010 11:45 am    Post subject:
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: 578
Location: USA

PostPosted: Thu Sep 09, 2010 6:30 pm    Post subject:
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    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 Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts SORT CARD to remove duplicates & ... mkk157 DFSORT/ICETOOL 17 Tue Jul 08, 2014 9:04 pm
No new posts Remove the duplicates without sorting... maki_psg JCL & VSAM 13 Tue May 13, 2014 10:32 pm

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