Get unique values and the respective count..



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Get unique values and the respective count..

Postby manojul22 » Fri Oct 26, 2012 5:19 pm

Requirement
I need to get the unique values and the respective counts.
Sample Input
|abc|^qwef|^asdr|^zxc|^
|^abc|^zxc|
|abc|^qwef|^asdr|^zxc|^
|^abc|^zxc|^abc|^zxc
Expected output
abc 5
qwef 2
asdr 2
zxc 5
I have 1.4 million records which is the unload of one specific field(var char) from a DB2 table.
The record can have n number of values(like abc, qwef etc) the length is also not fixed.

Please suggest.
manojul22
 
Posts: 2
Joined: Fri Oct 26, 2012 4:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Get unique values and the respective count..

Postby BillyBoyo » Fri Oct 26, 2012 5:51 pm

What do the "carats" indicate?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Get unique values and the respective count..

Postby manojul22 » Fri Oct 26, 2012 5:58 pm

New line feed in mainframe
manojul22
 
Posts: 2
Joined: Fri Oct 26, 2012 4:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Get unique values and the respective count..

Postby BillyBoyo » Fri Oct 26, 2012 7:31 pm

You mean NL or you mean LF? So you have strings of different lengths, some with a byte with a non-display value leading or trailing, some fields solely with the non-display. And you want counts of each different, ignoring any of the non-display characters present - and the fields are delimited by the pipe, your file is VB. Is there a maximum number of fields on a record? What is the LRECL? Maximum lenght of a field? Do you want the "empty" fields counted?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post