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 abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts Update the Sortout file with record c... karthik_sripal SYNCSORT 8 Tue May 17, 2016 8:52 pm


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