Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Well, you need a file with a business date on it. Do you have one handy?
In one step take the date from that file and generate a SYMNAME, along the lines of
Code:
BUSINESS-DATE-MONTH,C'CCYY-MM'
Then, in your existing sort step,
Code:
INCLUDE COND=(TRANSACTION-MONTH,EQ,BUSINESS-DATE-MONTH)
Where TRANSACTION-MONTH is another SYMNAME, something like
Code:
TRANSACTION-MONTH,startpos,length,CH
Where startpos and length are apporpriate to your file.
Should be dynamic enough. It is also what Dick has already suggested. There are some recent examples in JCL forum here (where SYNCSORT questions live).
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
You could dynamically generate the INCLUDE statement and then use it in the process.
You could "can" several years of these as members in a PDS and then use them by specifying a symbolic parameter for the member needed for a particular run (coordinating with the scheduling people).
You might also talk with the scheduling people and learn how they do this in other processes.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
I was thinking of something like this one. Through this you should find some differing examples.
If you have a business date available, use it. Will always work, assuming restored correctly for re-run.
If you don't have a business date, first castigate anyone remaining who was involved in the original "design" of your system, then you can try to adapt enrico's solution to Syncsort, just remember that for a re-run after the end of the month you'd have to hard-code a value. And watch for any schedule changes. If it is scheduled for last day of the month, will work if step starts before midnight, won't work if after midnight.
The sort is designed in such a way the include and omit conditions are processed before INREC/OUTREC statements. So with the approach i followed you cannot have the include statement in the same step of formatting the input file.
In ICETOOL you can do it in single step using the same approach.