Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
First you've been around long enough to know to code your own posts here.
Second, at the highest level it does not matter which order you code your SORT control cards in. SORT will always run them in the order it wants. Here's the order your cards will run in:
You are allowed multiple OUTFILs, but only one OUTREC.
How to resolve it depends on what you are supposed to be doing. If all is OK except for two OUTRECs, then make the first OUTREC into an INREC is the simplest. Or merge the two OUTRECs. Or if they are supposed to be OUTREC on OUTFIL, use BUILD instead to avoid such confusion.
I have looked up the explanation but I am wondering how the first SORT is running in production.
Code:
WER235A {ddname} {INREC,OUTREC} RDW NOT INCLUDED
EXPLANATION: The ddname will be SORTOUT, SORTOFxx, SORTOFx or the
ddname provided by an OUTFIL FNAMES parameter. Four bytes must be
provided for the RDW of the variable length output record in
the FIELDS parameter of the INREC, OUTREC or OUTFIL OUTREC
specification. These bytes must appear at the beginning of the record and
must not be edited.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Well, there's the confusion I was talking about.
If you look at the first block of code, you'll see that the line before both OUTRECs end in a comma, so the OUTREC is part of OUTFIL.
Without the preceding comma, the OUTREC is a separate statement. And you can only have one OUTREC per set of control cards.
On INREC and OUTREC use BUILD instead of FIELDS for new code. On OUTFIL use BUILD instead of OUTREC for new code. Standardises and saves confusion. See here.
As to your new error, your input file is VB but you are treating the data in OUTREC as FB. VB needs an RDW, always.
Probably because the OUTREC has "fallen off" the OUTFIL. Perhaps you'd best explain what you are trying to do?