Trailer record count



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Trailer record count

Postby Rajesh Meenakshi » Tue Dec 01, 2009 4:07 pm

In the below file of recl 60, FB, 16th line reads the trailer count.

000001 1 200712012009120110008206
000002 2T04 437492900 20071210200911300086 15
000003 5T04 4374929003606 NC 0100 04256489999991
000004 7T04 4374929003606 NC 01000152S000003
000005 7T04 4374929003606 NC 01000165S000001
000006 7T04 4374929003606 NC 01002600S000001
000007 7T04 4374929003606 NC 01002972S000003
000008 7T04 4374929003606 NC 01003777S000002
000009 7T04 4374929003606 NC 01003955S000003
000010 7T04 4374929003606 NC 01004048S000002
000011 7T04 4374929003606 NC 01004129S000002
000012 7T04 4374929003606 NC 01005186S000003
000013 7T04 4374929003606 NC 01005458S000003
000014 7T04 4374929003606 NC 01006952S000002
000015 7T04 4374929003606 NC 01007362S000003
000016 9 000000012

The count starts at column 31. I need to change the trailer count as per the line number (i.e.,) 16th line should read as
000016 9 000000016
Rajesh Meenakshi
 
Posts: 2
Joined: Tue Dec 01, 2009 3:42 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Trailer record count

Postby Frank Yaeger » Tue Dec 01, 2009 8:58 pm

Here's a DFSORT job that will do what you asked for:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/60)
//SORTOUT DD DSN=...  output file (FB/60)
//SYSIN    DD    *
  OPTION COPY
  OMIT COND=(1,1,CH,EQ,C'9')
  OUTFIL REMOVECC,
    TRAILER1=('9',31:COUNT+1=(M11,LENGTH=9))
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post