The output should be like as follows , i dont want to distrub tha Header and Trailer
<Header>000050 000000????<Trailer>
<Header>000045 000000????<Trailer>
<Header>000055 000000????<Trailer>
<Header>000002 000000????<Trailer>
<Header>000025 000000????<Trailer>
,
Can you explain how it will works?
The input and output records you are showing are same.
if you want some thing like
<Header>000002 000000????<Trailer>
<Header>000025 000000????<Trailer>
<Header>000045 000000????<Trailer>
<Header>000050 000000????<Trailer>
<Header>000055 000000????<Trailer>
in the out put you can easily give a sort field with your second field as the
base key for sort
SORT FIELD(STARTING POSN AND LENGTH OF THE FIELD)
This will sort the file with your header and trailer and on the first field in the record after the header
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
i am not able understand that,
Well, we're trying but we're not able to understand what you want. You show records that look like they all have the same header and trailer and a second field that you want to sort on. That's a simple case of sorting on that field. But you say you don't understand that.
Are the headers and trailers actually different in each record as Priyesh suggests? If so, please say so. Better yet, show us a better example of what the input records look like and what you want the output records to look like (with actual values). Also, what is the RECFM and LRECL of the input file, and what is the position, length and format of the header, sort field and trailer?