Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
write count alongside.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: write count alongside.
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    Post subject:
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    Post subject: Reply to: write count alongside.
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    Post subject:
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    Post subject: Reply to: write count alongside.
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us