Assume I have a sequential file as following:
HDR20050710
DTLaaaaaaaa
DTLbbbbbbbb
...
TRL00000000
Now I want to count the records in this file, including HDR, DTL & TRL, and put the result to the last of TRL, for example:
HDR20050710
DTLaaaaaaaa
DTLbbbbbbbb
TRL00000004
Can dfsort achieve it? Anybody can help?
Thanks in advance.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can use the DFSORT job below to do what you asked for. You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's new COUNT+n function. Only DFSORT has this function, so if you don't have DFSORT, you won't be able to use it. If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct, 2010), you can now use DFSORT's new IFTRAIL function to update the trailer record directly like this: