Tony, You need to use INREC to parse the record and specify the position to be sorted that you used on the BUILD statement..
Check this link which explains the order of processing for DFSORT http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/1.5.4? Example //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * ----+----1----+----2----+----3----+----4----+----5----+----6----+----7- SOMETHINGZZZELSE SOMETHINGBBBBBELSE SOMETHINGAELSE //SORTOUT DD SYSOUT=* //SYSIN DD * INREC PARSE=(%22=(STARTAFT=C'SOMETHING',ENDBEFR=C'ELSE)',FIXLEN=10)), BUILD=(001:%22, THE PARSE FIELD 011:1,120) OTHER STUFF I WANT SORT FIELDS=(1,10,CH,A) I WISH TO SORT ON %22 //* If the parsed field is numeric then you need use UFF format. Sri Hari Kolusu DFSORT Development IBM Mainframe Discussion List <[email protected]> wrote on 01/22/2013 09:49:59 AM: > From: "Tony B. AOL Mozilla" <[email protected]> > To: [email protected], > Date: 01/22/2013 09:51 AM > Subject: DF/SORT, use parsed field as the sequence field ? > Sent by: IBM Mainframe Discussion List <[email protected]> > > Calling all DF/SORT experts: Is it possible to parse a field from the > input record (which floats, of course, otherwise we wouldn't be > parsing), and use the located field as the sort sequence? > > For example: > > OUTFIL FNAMES=SORTOUT, > PARSE=(%22=(STARTAFT=C'something',ENDBEFR=C'else)',FIXLEN=10)), > BUILD=(001:%22, the parse field > 011:1,120) other stuff I want > SORT FIELDS=(%22,CH,A) I wish to sort on %22 > > > > Apologies in advance if I failed to locate the capability in the manual. > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
