Frank, Thanks once again! This looks like just what I need.
I may not get around to trying it until tomorrow, but I wanted you to know I saw it and will try it out on my file. I'll respond again after I work on it. Peter > -----Original Message----- > From: IBM Mainframe Discussion List [mailto:[email protected]] On > Behalf Of Frank Yaeger > Sent: Wednesday, March 03, 2010 12:45 PM > To: [email protected] > Subject: Re: SORT question: How to store record count in existing trailer? <Snipped> > Peter, > > That's no problem. Here's a DFSORT job that will do what you asked for: > > //S1 EXEC PGM=SORT > //SYSOUT DD SYSOUT=* > //SORTIN DD DSN=... input file (VB/8004) > //SORTOUT DD DSN=... output file (VB/8004) > //SYSIN DD *.. > OPTION COPY > * Add SEQNUM between RDW and data. > INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:SEQNUM,11,ZD,16:5)), > * Use SEQNUM-2 to put count of data records in > * last record (identified by X'FF'). > IFTHEN=(WHEN=(16,1,BI,EQ,X'FF'), > OVERLAY=(36:5,11,ZD,SUB,+2,TO=ZD,LENGTH=11)) > * Remove SEQNUM. > OUTREC BUILD=(1,4,5:16), > /* This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

