Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You say each comment field is 4096 characters and that you can have a maximum of 10 repeating records. That would give a maximum length for the combined comments of 40960 characters. That's much longer than the 32000 bytes you show for the output comments field as well as the maximum length for an FB record. Something doesn't add up here.
We can use the maximum bytes it can accomodate. Lets say output comment field is PIC X(32000). LRECL of output is 32500. The rest of the data can be truncted from comment field.
We can also set maximum ocuurence of repeating records to 8 or less.
Is there any way of concatenating multiple rows of CHAR field into one fields using SORT/JCL.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
I don't really understand how you can truncate the comment fields. So I'll just show you a simpler example with a max of 4 comments of 10 bytes each. Hopefully, you can extrapolate whatever you need from that. Here's the DFSORT/ICETOOL example:
If your records are already in order by positions 1-3 as shown in your original example, you can use a COPY as the second operator instead of a SORT and remove the SORT statement from CTL2CNTL.