2) your “INPUT” is not your input data, but a fragment of SORT utility statements
3) your actual input data is missing, and not commented in any manner
4) your output data is unclear; even: is it your actual output, or desired output, or smth. else?
5) remains unclear: do you want to ask something, or to demonstrate your efforts, or what? If you are asking: what exactly is your question - there is no one word around your CODE block…
6) the words “INPUT”, “OUTPUT”, and other unclear stuff is not a code; should not be enclosed into code-tags
7) please, clarify your sentence “pipe de-limited by using sort” - what do you mean by that?
Going forward please use "SEARCH" first to find something , you will see plenty of similar issues discussed and resolved , give a try which will avoid posting basic questions and you will learn.
Joined: 15 Aug 2015 Posts: 1335 Location: Bamberg, Germany
Check where the fields in the HEADER1 are starting and what lengths you have specified (fields @35 and @55 and alikes). You will be able to fix that yourself.
Also this topic should be moved to SYNCSORT section of the forum.
It would be nice to see (as has been asked several times): what is your desired output? How do you expect it to look like?
In the parameter HEADER1 all the specified fields are overlapping, except the last one.
In this simple case it is as obvious as a piece of cake. In a more complicated case it makes sense to start adding this large number of parameters one by one, in order to detect: which of them is causing the error?
When starting from a huge mess of keywords and values at once it’s getting very hard (or impossible) to find out: what is the problem?
P.S.
It remains a full mystery: what the “pipe-delimited SORT statement” does mean?
Please, use the Calculator application to carefully calculate your real OUTREC size, by summarizing all field sizes. I, personally, refuse to do this calculation for yourself, but SORT utility did this, and displayed its message stating that the record size is wrong.
Please, verify the real LRECL parameter for your real dataset allocated to your //SORTOUT DD (not just your comment on expected record size!)
BTW, there must be displayed extra messages from SORT, stating both LRECL of the output dataset, and the length of the record created by your OUTREC parameter. Those message would be useful for yourself, but you have ignored them, asking the forum instead…
And this is moved to Student Section apparently. Please research on errors and link provided, understand how HEADER1 works and do a test fixing one offset at a time from HEADER1 and DETAIL until you get successful.
The message “INCOMPATIBLE LRECL” means that the size of OUTREC= is not equal to the available value of SORTOUT LRECL. This is the primary reason which needs to be fixed first of all.
I had to count on my fingers and this does come to 193.
Code:
186:424,8
This however comes to 194. Hence the error.
Code:
186:C'DB_USERID'
This is why I just leave it off the JCL, then no errors.
In this case it will be different error even if you don't code RECFM and LRECL as HEADER1 don't match up with DETAIL on total length, In any other case ( without HEADER1) you are right.
Let us give chance to let TS figure that out. It is simple by now what to fix.