× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: Numeric search on Phone number
  • From: Joel Fritz <JFritz@xxxxxxxxxxxxxxxx>
  • Date: Fri, 28 Apr 2000 08:52:17 -0700

Kind of depends on what the key is in the file you're using to look up the
phone numbers.

Assuming it's the 10 character phone number with no separators, you need to
SETLL using a partial key and load up the subfile with all the values that
match the partial key.  

I don't think it would be a good idea to include all of the numbers greater
than or equal to the partial key unless there's a very small number of phone
numbers.  If the partial key is '1', you're going to end up with every phone
number.  If that's the way the assignment is worded, you could do it that
way.  Assuming you want only numbers that match the partial key:

The loop to load the subfile would be conditioned on end of file and the
partial key value like DOW NOT %eof(phonefile) AND %subst(phone#, 1,
%len(lookupvalue)) = lookupvalue.  You might find no numbers that begin with
'708' so you may need to incorporate that into your logic. If there are
separate fields for area code, prefix, and number or some other variation,
you have to adjust accordingly. 

I think list custom is to include smaller bits of code than you posted.
Besides, people might get side tracked on the rest of the code.  I did
notice that the LEAVE and ITER in the main line SELECT are unnecessary.  Try
commenting them out but leave their WHENs and see what happens. <g>

> -----Original Message-----
> From: Phil Hayes [mailto:PHayes1@Prodigy.net]
> Sent: Friday, April 28, 2000 6:39 AM
> To: RPG400-L@midrange.com
> Subject: Numeric search on Phone number
> 
> 
> Greetings,
> 
> I am finishing up my last program as part of a group project 
> at school.
> The problem is being able to search a phone number by 1 or 
> all 10 digits of
> a phone number. E.g., if the user types 708 the user should 
> see all of the
> 708 and above.
> I know there are some very smart programmers who know how to 
> solve this.
> 
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.