Puffe wrote:In position 5-12 there is a date in format (yyyymmdd) that differs from time to time.
So I want to add one month to that date-value and I want the day to be the first weekday of the new month, so it shouldn't be a saturday or sunday.
Let say that the date is 20120326 so the result I want in my output file should be:
I think this can be done by using DFSORT.
Your description is confusing. I guess you just need to get the first weekday of the next month. Assuming your input is RECFM=FB and LRECL=80, the following DFSORT JCL will give you the desired results.
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
//SORTOUT DD SYSOUT=*
//SYSIN DD *
The output from the above job would be