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



Hi,

To check valid data within your string, you may try something like this:

Select Case When Length(Trim(Translate(Substr(YourString, StrPosPacked,
LengthPacked-1), ' ', '1234567890'))) > 0
or Substr(a, LastPosPacked, 1) not in ('F', 'D')
Then 'Invalid Packed Data'
Else 'Valid Packed Data'
End
From YourTable
;;

StrPosPacked is the begin of your packed data
LengthPacked is the length of the packed data (in my example the last
character is stripped off because I only wanted to check if the rest is
numeric.
LastPosPacked is the last character of the packed data, which must bei
either F or C or D for negative data

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"


-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von
Dean.Eshleman@xxxxxxxxxxxxxx
Gesendet: Thursday, 02. July 2009 22:40
An: midrange-l@xxxxxxxxxxxx
Betreff: Validating packed data in a character field

Hi,

One of our files in a third party application is getting corrupt data
loaded into one of the fields. The field is a 13 position field and it
contains 4 fields within it. These 4 fields are the key to a file. The
first 3 positions are character, the next 2 are a signed number, the next
3 are a signed number and the final 5 are an 8 digit packed number. It is
the 8 digit number that is corrupted sometimes. Is there an SQL statement
that I can use to find the corrupt numbers? I would want to report them
so that they can be fixed.

Dean Eshleman,
MMA, Inc.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.