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
 

 

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 Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm


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