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

Difference between Find and Locate Commands


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Mon Nov 19, 2007 4:52 pm
Reply with quote

Hi all

Could anyone please explain to me what is the difference between FIND and LOCATE Commands?


Thanks,
Gnanas
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Nov 19, 2007 5:22 pm
Reply with quote

without looking at the manuals ( so I might be wrong )

find means search for a string in the data
locate means go to a line number ( relative/absolute depending on the number setting )
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Tue Nov 20, 2007 2:39 am
Reply with quote

Find on a member list will find the search chars anywhere in the names, and F5 will repeat-find.

Locate looks starting with the first char of each name and positions you on the first member name that matches. If you Locate on all 8 chars, it's the top name; o.w., it's the 2nd name on the screen.

Neither requires wildcard chars.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Nov 20, 2007 11:38 am
Reply with quote

gnanas,

The difference between FIND and LOCATE can be best seen while searching for members inside a PDS.

Say u have a PDS where the members are names AA,BB and CC

First u search for the member BB using FIND command. Once this is executed your member BB will be the first member displayed.

Now when you again search for AA, it will display *Bottom of list reached*. But if you LOCATE AA then AA would be found as LOCATE searches the whole list.
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Thu Jan 08, 2009 2:18 pm
Reply with quote

Say we are searching for a member XYZ in a pds,

The members of the pds are

ABC
ACC
BCF
DEF
XXF
XYZ
ZDF

Locate compare the first character X with first character of first member and if found not same, it wil not compare the rest of the members till encounters a character change ( observe that members will be sorted alphabatically). This process continues till it encounters X then it compares 2nd char and so on.

Where as FIND will compare the entire string with all the members.

That is the reason why locate will point to the searched member faster than find. Try to find and locate in a pds which has more than 4000 members ( ideally loadlibs)

Correct me if I am wrong
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


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

PostPosted: Thu Jan 08, 2009 10:11 pm
Reply with quote

I see this is an old thread but doesn't it make a lot of difference on which ISPF panel the FIND or LOCATE command is keyed in? I would have suggested, "F1 is your friend". icon_smile.gif
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Timestamp difference and its average ... DB2 11
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts Find the occurrence of Key Field (Par... DFSORT/ICETOOL 6
Search our Forums:

Back to Top