Radoslaw, You can use the DATASORT operator to just sort the data and ignore the headers/trailers. Here is a sample JCL. I assumed that the lastname starts at position 15 for a length of 13.
//STEP0100 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN DD * FIRSTNAME LASTNAME YEAR OTHERDATA ---------- --------- ---- --------- JOHN SMITH 1945 EEEEEEEEE JOE ZAWINUL 1932 RRRRRRRRR GEORGE ALTMARK 1954 FFFFFFFFF //OUT DD SYSOUT=* //TOOLIN DD * DATASORT FROM(IN) TO(OUT) HEADER(2) USING(CTL1) //CTL1CNTL DD * SORT FIELDS=(15,13,CH,A) //* Further if you have any questions please let me know Thanks, Kolusu DFSORT Development IBM Corporation IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> wrote on 05/19/2017 01:54:12 PM: > From: "R.S." <r.skoru...@bremultibank.com.pl> > To: IBM-MAIN@LISTSERV.UA.EDU > Date: 05/19/2017 01:54 PM > Subject: DFOSRT and headers > Sent by: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> > > How to exclude header lines from being sorter/filtered? > > For example, I have the following file: > > FIRSTNAME LASTNAME YEAR OTHERDATA > ---------- --------- ---- --------- > JOHN SMITH 1945 eeeeeeeee > JOE ZAWINUL 1932 rrrrrrrrr > GEORGE ALTMARK 1954 fffffffff > > > > I want to sort by lastname: > FIRSTNAME LASTNAME YEAR OTHERDATA > ---------- --------- ---- --------- > GEORGE ALTMARK 1954 fffffffff > JOHN SMITH 1945 eeeeeeeee > JOE ZAWINUL 1932 rrrrrrrrr > > > > Actually I see the solution: copy header to temp file (STOPAFT=2) > and merget it with sortout, but I believe there is simpler way to do that. > > > > Regards > -- > Radoslaw Skorupka > Lodz, Poland > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN