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 

Searching multiple values on same line?

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


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Fri Dec 05, 2008 1:08 pm    Post subject: Searching multiple values on same line? Reply with quote

Hi,

I need to search a file for multiple values on same record using File-Aid or SORT. Is it possible?

Input:
Code:

XTTK9M0000775000001246362009M95820
1TTK9M0000775000001246362009M95820
XT5K9M0000771000001246362009M95820


Output:
Code:

XTTK9M0000775000001246362009M95820
1TTK9M0000775000001246362009M95820


I want to copy only those records that have '775' and '124636' on same line.

Please suggest.

Thanks.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Dec 05, 2008 1:50 pm    Post subject: Reply with quote

You can use these DFSORT control statements:

Code:

  OPTION COPY                                               
  INCLUDE COND=(11,3,CH,EQ,C'775',AND,19,6,CH,EQ,C'124636') 

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Tue Dec 09, 2008 6:45 am    Post subject: Reply with quote

Frank, I thought of that but did not work for me because the 2nd information does not always start at 19th column Sad

Thanks.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Dec 09, 2008 12:31 pm    Post subject: Reply with quote

Quote:
I thought of that but did not work for me because the 2nd information does not always start at 19th column


Sigh. Then why didn't you mention that? If you knew it was important, why didn't you make it crystal clear that's what you wanted?

Assuming you want to search 1-34 as per your example, you can use these DFSORT control statements:

Code:

  OPTION COPY                                               
  INCLUDE COND=(1,34,SS,EQ,C'775',AND,1,34,SS,EQ,C'124636')

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Wed Dec 10, 2008 1:11 am    Post subject: Reply with quote

OOPS..... bonk Sorry Frank..... Embarassed

Thanks for the idea Exclamation
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Thu Dec 11, 2008 6:40 am    Post subject: Same achieved using File-Aid - JUST FOR SHARING only. Reply with quote

Hi,

I was trying this idea on File-Aid and succeeded.

Code:

//STEP1   EXEC PGM=FILEAID                     
//SYSUDUMP DD  SYSOUT=*                       
//SYSPRINT DD  SYSOUT=*                       
//SYSLIST  DD  SYSOUT=*                       
//SYSTOTAL DD  SYSOUT=*                       
//DD01     DD  *                               
XTTK9M0000775000001246362009M95820             
1TTK9M0000775000001246362009M95820             
XT5K9M0000771000001246362009M95820             
//DD01O    DD SYSOUT=*                         
//SYSIN    DD  *                               
$$DD01 COPY IF=(1,0,C'775'),AND=(1,0,C'124636')
END                                           
/*                                             


I thought to share this alternative solution with group here.

Thanks.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
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