Learn to use the code tags yourself, it saves myself and other moderators from having to do YOUR work for you.
goes in here
- Pretty easy isn't it.
Learn to start a new thread, posting on the back of a five year old thread which was totally unrelated is just plain idle laziness.
I have put this into the DFSORT section as your previous effort was tagged onto a SORT product question. But hey ho, as YOU HAVE NOT bothered to say which language you would like help in, how the hell can I possibly know, or anyone else that may wish to help you.
So, you need to tell us -
1) A lot more about your request.
2) Which languages or utilities you are looking for a solution with.
3) Some information regarding the RECFM / LRECL of your datasets.
4) Relative positions and lengths of field being manipulated.
5) Any other conditions / checks that may exist.
6) Most important What you have tried so far and the failing results.
Please, learn to help yourself and those that may want to help you, you have been a member of the forum for 12 years now.
I need SORT utility to get the desired output. Every two records are related and the both must be affixed with first 4 characters of 1st record, 8 chars from position 18 of 1st record and 8 chars from position 18 of 2nd record.
I hope I made my requirement clear. If it is not sufficient, please let me know. Thank you!
Which SORT product are you using - DFSORT or SYNCSORT - and it's release level.
RECFM / LRECL of the records - as requested above
Positions of the added output fields - as requested above
What you have tried yourself and the failing results
Not having used SORT for ages but you can create an intermediate record by appending the second record to the first, and then working with the newly created record - two passes of the data will be needed I think.
Or you could wait for a suggested possible one pass solution from "one of the better sorts" on the forum
However, until we see what you have already tried ...................................
Here is a version of expat's idea above assuming FB/LRECL=80 input/output data. Push the first record onto the second record and then use the 'merged' second record to write two output records with the required fields in OUTFIL