IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to search for members in PDS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bhagyashree Panigrahi

New User


Joined: 03 Mar 2009
Posts: 7
Location: Pune

PostPosted: Thu Aug 20, 2009 2:31 pm
Reply with quote

I am tryig to write a jcl which will select the members in a PDS having String A and String B in it. I tried using SRCHFOR but it searches for members with the OR condition. That means if i provide the below code
//SYSIN DD *
SRCHFOR 'STRING A'
SRCHFOR 'STRING B'
/*
The member names that will be found are the ones having 'STRING A' or 'STRING B' or both. But i want to display member names which have only both the the strings('STRING A' and 'STRING B' )

Please provide a sample code for the same.
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Thu Aug 20, 2009 3:05 pm
Reply with quote

Do you want that the member should contains strings in the data or the string are the member name, if so then use 3.14 and run a batch job to search for the member.
COuld you please explain the requirement if this does not solve ur problem
Back to top
View user's profile Send private message
Bhagyashree Panigrahi

New User


Joined: 03 Mar 2009
Posts: 7
Location: Pune

PostPosted: Thu Aug 20, 2009 4:38 pm
Reply with quote

What I am trying to do here, is find the members of PDS which have both string A and string B in them. I do not want the members which have only String A or only String B.

Thanks,
Bhagyashree
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Aug 20, 2009 4:40 pm
Reply with quote

Looks like it may be a two step job,

1) Find all members with string A
2) Find all members with string B
3) Compare the members and select only the same names.
Back to top
View user's profile Send private message
Bhagyashree Panigrahi

New User


Joined: 03 Mar 2009
Posts: 7
Location: Pune

PostPosted: Thu Aug 20, 2009 4:47 pm
Reply with quote

I have some 50 strings. I need to pick up all members having string A and atleast one of the other 49 strings in it. In logical way it would be (string A) AND (string B OR stringC OR stringD etc). how do I go about doing it?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Aug 20, 2009 4:57 pm
Reply with quote

Again, does n't it look like this?

1) Find all members with string A
2) Find all members with strings-B or C or D or E....
3) Compare the members and select only the same names.
Back to top
View user's profile Send private message
Bhagyashree Panigrahi

New User


Joined: 03 Mar 2009
Posts: 7
Location: Pune

PostPosted: Thu Aug 20, 2009 4:59 pm
Reply with quote

I did think of doing that. However, is there any way to do it in one step using SRCHFOR?

Thanks,
Bhagyashree
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Aug 20, 2009 5:37 pm
Reply with quote

Bhagyashree Panigrahi wrote:
I did think of doing that. However, is there any way to do it in one step using SRCHFOR?

If there were, do you not think that we might have said so icon_rolleyes.gif
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1248
Location: Richfield, MN, USA

PostPosted: Thu Aug 20, 2009 8:28 pm
Reply with quote

If you have File-Aid, I think you can accomplish this in 1 step. It's been a while since I've done it and don't have mainframe access at this time.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Aug 20, 2009 8:41 pm
Reply with quote

Just use:
Code:
//SYSIN DD *
   SRCHFOR  'STRING A'
   SRCHFORC 'STRING B'
/*

And if you want STRING A followed by STRING B you only need:
Code:
//SYSIN DD *
   SRCHFOR  'STRING A'
   SRCHFORC 'STRING B',+
/*
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Aug 20, 2009 8:47 pm
Reply with quote

Ooops, this works only if the strings are on the same line!
If they can be anywhere in the member, you'll need multiple steps.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Thu Aug 20, 2009 8:56 pm
Reply with quote

running the search with IDPFX,XREF

will make it easier to write a simple rexx to process the srchfor output
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Sun Aug 23, 2009 2:58 pm
Reply with quote

Adding FINDALL to the PARM options will allow you to search for "STRING A" and "STRING B" in the members
Back to top
View user's profile Send private message
mayanksoni4u

New User


Joined: 08 Sep 2009
Posts: 3
Location: Bangalore

PostPosted: Tue Sep 08, 2009 3:31 am
Reply with quote

Hi,

I am trying to search a member in PDS,currently I am doing this through FILE-AID batch program by giving following command in SYSIN:

$$DD01 LMODDIR MEMBER= "member name"

Since I have hundreds of member to search ,FILEAID is taking lot of time to do that.

Can someone please suggest any other quick method.
Back to top
View user's profile Send private message
mayanksoni4u

New User


Joined: 08 Sep 2009
Posts: 3
Location: Bangalore

PostPosted: Wed Sep 09, 2009 4:19 am
Reply with quote

Also I tried searching same through 3.14 "SRCHFOR" option.Since all the members contains images It is taking more time than FILEAID.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Sep 09, 2009 9:46 pm
Reply with quote

Hello,

Possibly a re-design is in order if this is to be done more than rarely. . .?

Searching high volume will take time no matter how the data is searched.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Search two or more word with FILEAID Compuware & Other Tools 17
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts first column truncated in search result IBM Tools 13
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
Search our Forums:

Back to Top