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

counts of unique & duplicate records while sorting


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

New User


Joined: 21 Jun 2007
Posts: 19
Location: India

PostPosted: Tue Jul 17, 2007 4:16 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Jul 17, 2007 4:32 pm
Reply with quote

Srileka,

Please provide IP data for the above OP.
Back to top
View user's profile Send private message
Srileka

New User


Joined: 21 Jun 2007
Posts: 19
Location: India

PostPosted: Tue Jul 17, 2007 4:47 pm
Reply with quote

Few records in input file....

QW12510012616100605000032001032007-
QW12510012624100605000032001032007-
QW12910012806100605000032001032007-
QW12910012905100605000032001032007-
QW12910013127100605000032001032007-
QW12910013150100605000032001032007-
Back to top
View user's profile Send private message
Srileka

New User


Joined: 21 Jun 2007
Posts: 19
Location: India

PostPosted: Tue Jul 17, 2007 5:06 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Jul 17, 2007 5:48 pm
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jul 17, 2007 6:21 pm
Reply with quote

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
View user's profile Send private message
Srileka

New User


Joined: 21 Jun 2007
Posts: 19
Location: India

PostPosted: Tue Jul 17, 2007 7:15 pm
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Jul 19, 2007 11:23 pm
Reply with quote

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
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top