Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

counts of unique & duplicate records while sorting

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: counts of unique & duplicate records while sorting
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: 1439
Location: Bangalore,India

PostPosted: Tue Jul 17, 2007 4:32 pm    Post subject:
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    Post subject:
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    Post subject: Re: counts of unique & duplicate records while sorting
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: 1439
Location: Bangalore,India

PostPosted: Tue Jul 17, 2007 5:48 pm    Post subject:
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    Post subject:
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

http://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    Post subject: Re: counts of unique & duplicate records while sorting
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    Post subject:
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    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 How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 2 Tue May 09, 2017 6:31 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us