- This gives me the required Year and Month i.e. previous.
- However the date needs to be the 1st.
- As date of job execution varies, cannot subtract a precise count from date.
- In case I try to overlap the date in header with '01' is gives an error.
Thank you Arun for sharing your approach.
Using the above sort card the required date is populated in the Header section of output file.
However the OVERLAY function populates the required date on the 81st position of all the detail records read from INPUT file.
Any method to populate required date in header section without altering the detail records from input.
It is only required in that position prior to you using it. Once you have used it, it is no longer required, so you get rid of it. BUILD=(1,80) or IFOUTLEN=80 (if you have at least one IFTHEN already).
I'd go with John Del's suggestion. Both solutions work.