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

Summary report - Count of duplicate records


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

Active User


Joined: 06 Jun 2009
Posts: 115
Location: UK

PostPosted: Tue Jul 06, 2010 2:14 pm
Reply with quote

Hi,

I have never SORT to produce a report so far. However, I have used it for sorting, OUTREC, SPLICE etc.


LRECL=62, RECFM=FB, all the columns are definded as alphanumeric.

Code:
N6337957215295476N6337957215295476V203020100622201007227020300
N6340814358152612N6340814358152612V203020100622201007227020300
N6153057215295476N6153057215295476V203020100622201007227020300
N6259957215295470N6259957215295470V203020100622201007227020300
N6259957215295470N6259957215295470V203120100622201007227020300
N7026528643866904N7026528643866904V203120100622201007227020300
N7028957215295470N7028957215295470V203120100622201007227020300
N7030814358152618N7030814358152618V203120100622201007227020300
N7033814358152612N7033814358152612V203120100622201007227020300
N7041385786724045N7041385786724045V203120100622201007227020300
N7044671501009751N7044671501009751V203120100622201007227020300
N6280081433729847N6280081433729847V203020100622201007227020301
N6288591433729841N6288591433729841V203020100622201007227020301
Y6093724290872702Y6093724290872702V203020100622201007227020301
N6303581433729841N6303581433729841V203020100622201007227020301

Field Position Length
Entity 56 4
Subprod 60 3
MKTIND 35 5

Output Report format:
Entity Subproduct MKTIND Count
7020 300 V2030 4
7020 300 V2031 7
7020 301 V2030 4

Many thanks,
Zurich Lad
Back to top
View user's profile Send private message
anshul_gugnani

New User


Joined: 02 Nov 2009
Posts: 73
Location: Mumbai

PostPosted: Tue Jul 06, 2010 3:50 pm
Reply with quote

Hello zh_lad,

Below sort card will give you desired result -
Code:

  INREC OVERLAY=(63:56,04,60,3,35,5,75:C'01')                         
  SORT FIELDS=(56,04,CH,A,60,3,CH,A,35,5,CH,A)                       
  OUTFIL REMOVECC,NODETAIL,                                           
  HEADER2=(01:C'ENTITY  ',09:C'SUBPRODUCT  ',21:C'MKTIND  ',         
         29:'COUNT  ',/,                                           
             01:C'======',09:C'==========',21:C'======',29:'====='),   
  BUILD=(1,62),                                                       
  SECTIONS=(63,12,                                                   
  TRAILER3=(01:56,04,09:60,3,21:35,5,28:TOT=(75,02,ZD,EDIT=(IIIIIT))))


Hope this Helps,
Anshul.
Back to top
View user's profile Send private message
zh_lad

Active User


Joined: 06 Jun 2009
Posts: 115
Location: UK

PostPosted: Tue Jul 06, 2010 5:05 pm
Reply with quote

It worked!

ENTITY SUBPRODUCT MKTIND COUNT
================== ===== =====
7020 300 V2030 187
7020 300 V2031 158
7020 301 V2030 80
7020 301 V2031 73


Thank you very much! Right now I am busy with work. However, I will quickly come back to understand SECTIONS and TRAILER3.

Cheers!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jul 06, 2010 11:00 pm
Reply with quote

Alternatively, you can use a DFSORT/ICETOOL job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
OCCUR FROM(IN) LIST(OUT) NOCC BETWEEN(10) -
 HEADER('Entity') ON(56,4,CH) -
 HEADER('Subproduct') ON(60,3,CH) -
 HEADER('MKTIND') ON(35,5,CH) -
 HEADER('Count') ON(VALCNT,U05)
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
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 To get the count of rows for every 1 ... DB2 3
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top