View previous topic :: View next topic |
Author |
Message |
digitalnirmal Beginner
Joined: 06 Dec 2005 Posts: 21 Topics: 10
|
Posted: Mon Apr 17, 2006 4:46 am Post subject: wildcard in sort |
|
|
I have a file which contains a 10 character field
I want to sort out all records that have 'ABC anywhere in this 10 character field
eg:
Input
Code: |
xxxxxxxfsssdfddmssxxxxxxxxxxxx
xxxxxxxporABCjudexxxxxxxxxxxx
xxxxxxxererfshdmssxxxxxxxxxxxx
xxxxxxxABCghisksoxxxxxxxxxxxx
xxxxxxxfssdshdmssxxxxxxxxxxxx
|
Output
Code: |
xxxxxxxporABCjudexxxxxxxxxxxx
xxxxxxxABCghisksoxxxxxxxxxxxx
|
|
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Apr 17, 2006 5:18 am Post subject: |
|
|
digitalnirmal,
You need to use the SUBSTRING (SS) field comparision to get the desired results. Assuming that your field in question starts from pos 8 for a length of 10 bytes the following JCL will give you the desired results.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
XXXXXXXFSSSDFDDMSSXXXXXXXXXXXX
XXXXXXXPORABCJUDEXXXXXXXXXXXX
XXXXXXXERERFSHDMSSXXXXXXXXXXXX
XXXXXXXABCGHISKSOXXXXXXXXXXXX
XXXXXXXFSSDSHDMSSXXXXXXXXXXXX
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(8,10,SS,EQ,C'ABC')
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
digitalnirmal Beginner
Joined: 06 Dec 2005 Posts: 21 Topics: 10
|
Posted: Mon Apr 17, 2006 6:16 am Post subject: |
|
|
Thanks a lot @kolusu |
|
Back to top |
|
|
|
|