Page 1 of 1

SORT the records based on the second word

PostPosted: Wed Aug 19, 2020 1:30 pm
by seethahexa
Hello All,

I need a help to sort the fields based on the second word of the records,

Input:

ACHIEVEMENT UNIQUE
ACHIEVEMENT UNIQUE
ACHIEVEMENT UNIQUE1
BELL LAB
BELL LAB
BELL INC
BELL CORP

Output:
ACHIEVEMENT UNIQUE
ACHIEVEMENT UNIQUE1
BELL LAB
BELL INC
BELL CORP

Here the sort is based on the first is unique or not, if the first word is unique then we need to compare the next word, if the second word is unique we need to write in the output file, if the second word is not unique we will exclude, there is not size limit for the first and second word.

I am struck with this requirement in sortcards, please help me.

Re: SORT the records based on the second word

PostPosted: Wed Aug 19, 2020 6:08 pm
by sergeyken
1. Use INREC PARSE=(%1=...,%2=...),OVERLAY=(100:%1,%2) <- RTFM!

2. Use SORT FIELDS=(100,nnn,CH,A)

3. Use OUTREC BUILD=(1,100)