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
 

 

Summary report - Count of duplicate records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
zh_lad

Active User


Joined: 06 Jun 2009
Posts: 101
Location: UK

PostPosted: Tue Jul 06, 2010 2:14 pm    Post subject: Summary report - Count of duplicate records
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    Post subject:
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: 101
Location: UK

PostPosted: Tue Jul 06, 2010 5:05 pm    Post subject: Reply to: Summary report - Count of duplicate records
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 Moderator


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

PostPosted: Tue Jul 06, 2010 11:00 pm    Post subject:
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:

http://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    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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 7 Mon Mar 27, 2017 3:59 pm
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm


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