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

write count alongside.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Mon Mar 21, 2011 7:05 pm
Reply with quote

Hi,

Have a file with duplicate records (LRECL=800, RECFM=FB).

Input:
Code:

----+----1----+----2----+----3
RECORD1 ABC KEY-0102
RECORD1 ABC KEY-0102
RECORD1 ABC KEY-0101
RECORD2 ABC KEY-0102
RECORD1 ABC KEY-0000
RECORD2 ABC KEY-0102
RECORD2 ABC KEY-0102


There are two sets of duplicates in the above file (1st & 2nd are 1st set and 4th, 6th and 7th are 2nd set).

My expected output should contain each duplicate and count of duplicate records alongside at 805th column.

Output:
Code:

----+----1----+----2----+----3.....................................8----+
RECORD1 ABC KEY-0102                                                    2
RECORD2 ABC KEY-0102                                                    3


I have tried to use OUTFIL with SECTIONS and TRAILER3 but due to 256 bytes limitation on SECTIONS the job would fail with U00016 icon_exclaim.gif

Please help.

Thanks.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Mon Mar 21, 2011 9:01 pm
Reply with quote

Do you consider "duplicate records" to mean duplicate for the entire 800 bytes? or just duplicate for the 20-byte "key" (as shown in your example)?
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Mon Mar 21, 2011 10:00 pm
Reply with quote

Yes, duplicate for entire length of 800 bytes

Thx.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Mon Mar 21, 2011 10:15 pm
Reply with quote

Hopefully, you don't have more than a few hundred records, otherwise you will burn up LOTS and LOTS of CPU - but the below should work (untested).

Code:

  INREC FIELDS=(1,800,C'00001')
  SORT FIELDS=(1,800,CH,A)
  SUM FIELDS=(801,5,ZD)
  OUTFIL FILES=OUT,INCLUDE=(801,5,ZD,GT,00001)
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Mar 22, 2011 4:07 pm
Reply with quote

Thanks a lot icon_biggrin.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top