I have to create a JCL which does the following function in daily job.
I have to copy last 30 records of a file to another file using a JCL.
The number of records in the input file will vary daily. The last 30 records are summary records.
I know a solution, but need help.
In SORT which variable holds the record count. If I know record count I can use REPRO SKIP (record count - 30) to do my function.
The program which writes the output file (the input file for new JCL) is very complex one and has 10K lines in it, so we don't want touch it and it 20 years old!!!.
Here's a DFSORT/ICETOOL job that will 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 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: