I was trying to take an input file, and write out the same records with an extra field at the start.
Is there any generic symbol for the 'rest of the record to the end' rather than specifying the length? This would be good as I have a few different record lengths of various DB2 table unloads to process and could use the same sort parms.
Also, can the OUTREC processing work out the new record length?
From looking at the DFSORT manual, i thought it could but I get an error -
ICE027A K END OF FIELD BEYOND MAXIMUM RECORD LENGTH
Re:- the second part,
Here is some JCL lke I tried.
The LRECL of the old dataset is 221.
When I run this it works OK, creates a new Dataset with FB LRECL = 221, but the last character on each record is chopped off.
So what I would like would be a way so that it works out that the output records are 222 long.
With that OUTREC statement, DFSORT would determine that the output LRECL is 222 (unless you override it which you don't seem to be doing) and would NOT chop off the last character. I tried your job with DFSORT and I got LRECL=222 and the last character was there.
If you show me the //SYSOUT messages, as I requested in my previous post, I could tell you more.
The only way you could get LRECL=221 instead of LRECL=222 for that job is if the output LRECL is being set to 121 before DFSORT gets control. It could be that an ACS routine is doing that, but that's only a guess.
To demonstrate, if I use the equivalent of your job with no LRECL for the output data set like this:
I just figured out what's going on with your job. Your site has overridden the SOLRF option to be NOSOLRF. This tells DFSORT not to compute the output record length so it uses the input record length. I see this option overridden so rarely (because it's a bad idea) that I tend to forget about it.
You can get what you want by overriding NOSOLRF with SOLRF as follows:
You might want to ask your System Programmers why they are using NOSOLRF since it tends to confuse people.