View previous topic :: View next topic
|
Author |
Message |
rajatbagga
Active User
Joined: 11 Mar 2007 Posts: 199 Location: india
|
|
|
|
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 |
|
|
rajatbagga
Active User
Joined: 11 Mar 2007 Posts: 199 Location: india
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
rajatbagga
Active User
Joined: 11 Mar 2007 Posts: 199 Location: india
|
|
|
|
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 |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
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 |
|
|
|