View previous topic :: View next topic
|
Author |
Message |
cschablow
New User
Joined: 23 Jan 2018 Posts: 1 Location: USA
|
|
|
|
I have several jobs that bring in multiple interface files, some of which have the same value in the sort columns (there's a potential to have additional values), so they are basically already sorted.
The jobs have been updated to always sort the input file, but the files that are already "sorted" are changed:
SORT card:
Code: |
SORT FIELDS=(1,3,CH,A) |
Input file:
Code: |
********************************* Top of Data *****************
001$CRESER122517 032000 AK80-04 D00000001928 AL09
001$CRESER122517 522090 AK80-04 C00000000964 AL09
001$CRESER122517 290061 AK80-04 C00000000964 AL09
001$CRESER122517 117001 AL09-01 D00000001928 AK80
001$CRESER122517 032000 AK82-04 D00000002122 AL09 |
Sorted file:
Code: |
********************************* Top of Data *****************
001$CRESER122517 032000 AK80-04 D00000001928 AL09
001$CRESER122517 032000 OK06-06 D00000000000 TX46
001$CRESER122517 290061 UT04-04 C00000000000 WY05
001$CRESER122517 117001 WY05-01 D00000000000 UT04
001$CRESER122517 032000 WI02-02 D00000000000 WY05 |
Does anyone know how to avoid this?
Coded - do it yourself next time
You found the underline tags so using the code tags should be a doddle. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Read about stable and unstable sorts. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
SORT FIELDS=(1,3,CH,A) ,EQUALS
This will retain input order on equal keys.
Believe it or not, this is in the manual. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
A COBOL Mainframe guru, |
does not read no steenking manuals |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Nothing to do with JCL. Moved to DFSort on the assumption that that is your sort product. |
|
Back to top |
|
|
|