View previous topic :: View next topic
|
Author |
Message |
Srileka
New User
Joined: 21 Jun 2007 Posts: 19 Location: India
|
|
|
|
Hi,
I have a requirement to generate a report.
I have a file IN1 and the 5th position of each record has the division number(1,2,3,..9).
I want the number of total records, number of unique records, number of duplicate records(not including the first occurence) for each division.
Characters 1 to 14 determine the uniqueness of a record.
Below is the TOOLIN used in my ICETOOL step.
Code: |
//TOOLIN DD *
OCCUR FROM(IN1) LIST(DOUT) BLANK -
TITLE('REPORT WITH DUPLICATES') -
HEADER('DIVISION') ON(5,1,CH) -
HEADER('COUNT') ON(VALCNT)
SELECT FROM(IN1) TO(OUT) ON(1,14,CH) FIRST DISCARD(DIS)
OCCUR FROM(OUT) LIST(DOUT) BLANK -
TITLE('REPORT WITHOUT DUPLICATES') -
HEADER('DIVISION') ON(5,1,CH) -
HEADER('COUNT') ON(VALCNT)
OCCUR FROM(DIS) LIST(DOUT) BLANK -
TITLE('REPORT ON DUPLICATES') -
HEADER('DIVISION') ON(5,1,CH) -
HEADER('COUNT') ON(VALCNT)
/*
|
The output is
Code: |
REPORT WITH DUPLICATES
DIVISION COUNT
-------- ---------------
5 12644
9 2381
REPORT WITHOUT DUPLICATES
DIVISION COUNT
-------- ---------------
5 12639
9 2372
REPORT ON DUPLICATES
DIVISION COUNT
-------- ---------------
5 5
9 9 |
But i want the output to be
Code: |
DIVISION WITH DUPS WITHOUT DUPS DUPS
----------- ------------- ----------------- -----
5 12644 12639 5
9 2381 2372 9 |
Can someone tell me if this is possible? |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Srileka,
Please provide IP data for the above OP. |
|
Back to top |
|
|
Srileka
New User
Joined: 21 Jun 2007 Posts: 19 Location: India
|
|
|
|
Few records in input file....
QW12510012616100605000032001032007-
QW12510012624100605000032001032007-
QW12910012806100605000032001032007-
QW12910012905100605000032001032007-
QW12910013127100605000032001032007-
QW12910013150100605000032001032007- |
|
Back to top |
|
|
Srileka
New User
Joined: 21 Jun 2007 Posts: 19 Location: India
|
|
|
|
Hi Murali,
Few records in input file....
QW12510012616100605000032001032007-
QW12510012616100605000032001032007-
QW12510012616100605000032001032007-
QW12510012624100605000032001032007-
QW12910012806100605000032001032007-
QW12910012905100605000032001032007-
QW12910012905100605000032001032007-
QW12910012905100605000032001032007-
QW12910012905100605000032001032007-
QW12910013127100605000032001032007-
QW12910013150100605000032001032007-
kindly let me know if i need to provide any more information on the same. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Srileka,
Instead of writing all 3 the reports, write them to different files. Using SPLICE option, you could acheive your desired reuslts.
Sorry Im unable to provide you the code as Im bit occupied with my work. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Srileka
Quote: |
But i want the output to be |
Since you have already extracted the reports, and want them in horizontal fassion, you need to join the reports horizontally.
Check the Join fields from two files record-by-record Smart DFSORT Trick at
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/ |
|
Back to top |
|
|
Srileka
New User
Joined: 21 Jun 2007 Posts: 19 Location: India
|
|
|
|
Take your own time Murali..
But it'll be great if you give me the solution.
Thanks in advance.
Regards,
Srileka.V |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Srileka
Try this way, Just write the three parts of report(DOUT) into 3 separate file's DOUT1, DOUT2 and DOUT3.
Then you can concatenate them horizontally(as i have suggested above).
Let me know if you are going this way, i will help you in building the report. |
|
Back to top |
|
|
|