× 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.



SQL's set based nature allows for some very elegant solutions.  Display 
programs are a perfect fit for SQL cursors.  I only wish IBM would 
implement the ability to position on data values within a cursor.

Try doing something like this using RLA.  The file contains zipcodes and 
lat/long values.  STRQM will prompt the user for &zip and &mileage when it 
is run.

SELECT B.ZIPCODE AS ORIGINALZIP, A.ZIPCODE AS DESTINATIONZIP,
       CAST(SQRT( POWER(ABS(A.LAT-B.LAT)*69.1,2) + 
                  POWER(ABS(A.LONG-B.LONG)*53,2) ) AS DEC(5,2)) 
        AS MILEAGE
FROM BS660F AS A 
 INNER JOIN 
     BS660F AS B 
  ON SQRT( POWER(ABS(A.LAT-B.LAT)*69.1,2) + 
           POWER(ABS(A.LONG-B.LONG)*53,2) ) < &MILEAGE 
WHERE B.ZIPCODE = &ZIP 
ORDER BY MILEAGE DESC 

Regards,

Mark

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.