Peter Farley at IBM Mainframe Discussion List <[email protected]> wrote
on 03/29/2012 02:28:49 PM:
>...
>As can be seen, the trailer count is not correct.
>It should be 00000000009.
>...
I'm confused. Since you have 10 data records (1,2,3,4,5,5,6,7,8.9),
wouldn't you want the count to be 10, not 9?
Assuming you do, this would be a simpler DFSORT solution:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN01 DD DSN=... input file 1 (VB)
//SORTIN02 DD DSN=... input file 2 (VB)
//SORTIN03 DD DSN=... input file 3 (VB)
//SORTOUT DD DSN=... output file (VB)
//SYSIN DD *
OPTION VLSCMP,VLSHRT
OMIT COND=(((5,3,CH,EQ,C'000'),AND, OMIT(HEADER RECORD AND
(34,5,CH,NE,C'FILE1')),OR, NOT FILE1) OR
(5,3,CH,EQ,C'999')) TRAILER RECORD)
MERGE FIELDS=(5,3,CH,A),EQUALS
OUTFIL REMOVECC,
TRAILER1=(C'999FILE TLR CNT=',
COUNT-1=(TO=ZD,LENGTH=11),
C',DATE=000000')
/*
For your input example (SORTIN01-03), SORTOUT would have:
000FILE HDR DATE=032912,FILE=FILE1.NAME
001DATA REC 001
002DATA REC 002
003DATA REC 003
004DATA REC 004
005DATA REC 005
005DATA REC 005 SECOND TIME
006DATA REC 006
007DATA REC 007
008DATA REC 008
009DATA REC 009
999FILE TLR CNT=00000000010,DATE=000000
If that's not what you want for output, then please explain the
"rules" for getting from input to output more clearly.
Frank Yaeger - DFSORT Development Team (IBM) - [email protected]
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN