MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

wildcard in sort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
digitalnirmal
Beginner


Joined: 06 Dec 2005
Posts: 21
Topics: 10

PostPosted: Mon Apr 17, 2006 4:46 am    Post subject: wildcard in sort Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Apr 17, 2006 5:18 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
digitalnirmal
Beginner


Joined: 06 Dec 2005
Posts: 21
Topics: 10

PostPosted: Mon Apr 17, 2006 6:16 am    Post subject: Reply with quote

Thanks a lot @kolusu
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group