Posted: Wed Apr 16, 2008 5:25 pm Post subject: Validating Trailer Count on File Using SORT
Besides writing COBOL program, is it possible to use SORT on a job to validate trailer count on a file and return condition codes depending upon if number of detail records matching trailer count or not.
EXAMPLE 1
INPUT FILE:
Code:
1HDR
2DTLAAAAA
2DTLBBBBB
2DTLCCCCC
9TRL 00000003
Number of 2DTL records = 3, count on 9TRL record = 3
==> counts match and return code = 0
EXAMPLE 2
INPUT FILE:
Code:
1HDR
2DTLAAAAA
2DTLBBBBB
2DTLCCCCC
9TRL 00000004
Number of 2DTL records = 3, count on 9TRL record = 4
==> counts mismatch and return code > 0
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Apr 16, 2008 6:35 pm Post subject:
You can use a DFSORT job like the following to do what you asked for. Note that you need z/OS DFSORT V1R5 to use NULLOUT (it's not supported in DFSORT R14).
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum