Sponsored Content
Top Forums Programming Sybase ASE Soundex Function Issue -Need Suggestion Post 302997577 by durden_tyler on Tuesday 16th of May 2017 07:23:45 PM
Old 05-16-2017
Quote:
Originally Posted by Perlbaby
[FONT=Tahoma]
...
I am using Sybase Adaptive Server Enterprise/15.7 (ASE). Trying my luck on SOUNDEX function to get unique records
Though the command works for characters and provides unique code for similar outputs.
But when i try with Starting numbers ( Followed with Street address ) , soundex does not work efficiently . Below examples show 0000
for 2 distinct address shown. Ideally it should show two different codes as both are distinct values .
...
From the ASE documentation at: infocenter.sybase.com

Adaptive Server Enterprise 15.5
> Transact-SQL User's Guide
> Using the Built-In Functions in Queries
> String functions used for character strings or expressions
> Examples of using string functions

Code:
The soundex function converts a character string to a four-digit code for use in a comparison.
It ignores vowels in the comparison.
Nonalphabetic characters terminate the soundex evaluation.
This function always returns some value.

There's no additional information regarding soundex function in higher ASE versions.
So looks like you are out of luck here.
The soundex implementation in Sybase apparently works only on strings that contain characters from the alphabet; not on strings that contain numbers/digits.

Last edited by durden_tyler; 05-16-2017 at 08:30 PM..
This User Gave Thanks to durden_tyler For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sybase Connection Issue

I am trying this >$ /usr/sybase/bin/isql -UABC -Pdef -SXYZ -b Getting the following error. Help is appreciated (1 Reply)
Discussion started by: pinnacle
1 Replies

2. UNIX and Linux Applications

Sybase help: Open client, bcp function

To begin: I use Linux The Problem: I need bcp functionality for scripts. Perl modules, such as Sybase:xfer, require ctlib which comes with Sybase Open Client. Talking with Sybase sales reps is an exercise in futility and hate. They know absolutely nothing about their own products and will... (0 Replies)
Discussion started by: Bubnoff
0 Replies

3. UNIX for Advanced & Expert Users

case-function issue

This is my code *************** #!/bin/bash echo -e "no: \c" read no case $no in 1)fun;; *)echo "wrong";; esac fun() { echo "in" } this is my output error ***************** (2 Replies)
Discussion started by: ponmuthu
2 Replies

4. Programming

Sybase load statement issue

hi, I am trying to load a sybase table using a file ( unit separator is the delimiter) which is in IQ server. I Used load statment as below execute ('LOAD TABLE schemaname.tablename (' || ' name, age, date, Symbols) from ' || ' '' /filepath/file.txt '' ' || ' QUOTES off ' || ' DELIMITED... (0 Replies)
Discussion started by: irudayaraj
0 Replies

5. UNIX and Linux Applications

sybase ase installer

i'm looking for an installer of Sybase ASE 11.9.2.6 for HP-UX. tried buying from the local distributor but he can only give me the latest version. can anyone point me to where i could possibly get it? (0 Replies)
Discussion started by: sam_salazar
0 Replies

6. Programming

How to trim values in sybase ase?

HI Team I am using Sybase ASE15.7 version. Below is the sample column values . http://abc.lifeline.airs.com/support/ https://xyzbre.lifeline.airs.com/video/ Would like to know how to Trim http:// and https:// from above list of example Remove characters after first / Include only the... (3 Replies)
Discussion started by: Perlbaby
3 Replies

7. Programming

Sybase ASE - AVG Function Error

Hi Team - I am using Sybase ASE 15.7 version. Below query is throwing an error stating Error : incorrect syntax near the keyword 'OVER' SELECT EMPLOYEE_ID , EMPLOYEE , Department, CAST( Salary as DECIMAL( 10, 2 ) ) AS Salary CAST(AVG( Salary) OVER ( PARTITION... (3 Replies)
Discussion started by: Perlbaby
3 Replies

8. Programming

Sybase ASE: Query to find correct format issue.

Hi Team , I am new to Sybase Adaptive Server Enterprise/15.7 (ASE) and need some guidance to find the different values in serial format column. SELECT DISTINCT SERIAL_FORMAT FROM PRODUCTS It has values with below format which contains 12 digits hexadecimal characters with... (2 Replies)
Discussion started by: Perlbaby
2 Replies

9. Programming

Sybase ASE - Query Tuning - Need Suggestion

Dear Team Please provide suggestion on below query which is used in Sybase Adaptive Server Enterprise/15.7 (ASE). Query takes more time > 30 Mins to 1 Hr All required indexes are built Can we have any efficient approach to get the data retrieval faster for below query.Any help... (0 Replies)
Discussion started by: Perlbaby
0 Replies
Text::Soundex(3pm)					 Perl Programmers Reference Guide					Text::Soundex(3pm)

NAME
Text::Soundex - Implementation of the soundex algorithm. SYNOPSIS
use Text::Soundex; # Original algorithm. $code = soundex($name); # Get the soundex code for a name. @codes = soundex(@names); # Get the list of codes for a list of names. # American Soundex variant (NARA) - Used for US census data. $code = soundex_nara($name); # Get the soundex code for a name. @codes = soundex_nara(@names); # Get the list of codes for a list of names. # Redefine the value that soundex() will return if the input string # contains no identifiable sounds within it. $Text::Soundex::nocode = 'Z000'; DESCRIPTION
Soundex is a phonetic algorithm for indexing names by sound, as pronounced in English. The goal is for names with the same pronunciation to be encoded to the same representation so that they can be matched despite minor differences in spelling. Soundex is the most widely known of all phonetic algorithms and is often used (incorrectly) as a synonym for "phonetic algorithm". Improvements to Soundex are the basis for many modern phonetic algorithms. (Wikipedia, 2007) This module implements the original soundex algorithm developed by Robert Russell and Margaret Odell, patented in 1918 and 1922, as well as a variation called "American Soundex" used for US census data, and current maintained by the National Archives and Records Administration (NARA). The soundex algorithm may be recognized from Donald Knuth's The Art of Computer Programming. The algorithm described by Knuth is the NARA algorithm. The value returned for strings which have no soundex encoding is defined using $Text::Soundex::nocode. The default value is "undef", however values such as 'Z000' are commonly used alternatives. For backward compatibility with older versions of this module the $Text::Soundex::nocode is exported into the caller's namespace as $soundex_nocode. In scalar context, "soundex()" returns the soundex code of its first argument. In list context, a list is returned in which each element is the soundex code for the corresponding argument passed to "soundex()". For example, the following code assigns @codes the value "('M200', 'S320')": @codes = soundex qw(Mike Stok); To use "Text::Soundex" to generate codes that can be used to search one of the publically available US Censuses, a variant of the soundex algorithm must be used: use Text::Soundex; $code = soundex_nara($name); An example of where these algorithm differ follows: use Text::Soundex; print soundex("Ashcraft"), " "; # prints: A226 print soundex_nara("Ashcraft"), " "; # prints: A261 EXAMPLES
Donald Knuth's examples of names and the soundex codes they map to are listed below: Euler, Ellery -> E460 Gauss, Ghosh -> G200 Hilbert, Heilbronn -> H416 Knuth, Kant -> K530 Lloyd, Ladd -> L300 Lukasiewicz, Lissajous -> L222 so: $code = soundex 'Knuth'; # $code contains 'K530' @list = soundex qw(Lloyd Gauss); # @list contains 'L300', 'G200' LIMITATIONS
As the soundex algorithm was originally used a long time ago in the US it considers only the English alphabet and pronunciation. In particular, non-ASCII characters will be ignored. The recommended method of dealing with characters that have accents, or other unicode characters, is to use the Text::Unidecode module available from CPAN. Either use the module explicitly: use Text::Soundex; use Text::Unidecode; print soundex(unidecode("FranxE7ais")), " "; # Prints "F652 " Or use the convenient wrapper routine: use Text::Soundex 'soundex_unicode'; print soundex_unicode("FranxE7ais"), " "; # Prints "F652 " Since the soundex algorithm maps a large space (strings of arbitrary length) onto a small space (single letter plus 3 digits) no inference can be made about the similarity of two strings which end up with the same soundex code. For example, both "Hilbert" and "Heilbronn" end up with a soundex code of "H416". MAINTAINER
This module is currently maintain by Mark Mielke ("mark@mielke.cc"). HISTORY
Version 3 is a significant update to provide support for versions of Perl later than Perl 5.004. Specifically, the XS version of the soundex() subroutine understands strings that are encoded using UTF-8 (unicode strings). Version 2 of this module was a re-write by Mark Mielke ("mark@mielke.cc") to improve the speed of the subroutines. The XS version of the soundex() subroutine was introduced in 2.00. Version 1 of this module was written by Mike Stok ("mike@stok.co.uk") and was included into the Perl core library set. Dave Carlsen ("dcarlsen@csranet.com") made the request for the NARA algorithm to be included. The NARA soundex page can be viewed at: "http://www.nara.gov/genealogy/soundex/soundex.html" Ian Phillips ("ian@pipex.net") and Rich Pinder ("rpinder@hsc.usc.edu") supplied ideas and spotted mistakes for v1.x. perl v5.16.2 2012-08-26 Text::Soundex(3pm)
All times are GMT -4. The time now is 01:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy