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



I _always_ expect to write a validation program for data received from 
foreign systems, just to avoid such problems.  Generally, I kick out the 
records that have 'bad data', and produce a report of the invalid 
fields.  On some occasions, I have added code that loads a proper default 
into the bad field.

One of the systems I was dealing with (in the way back past) freely used 
spaces and nulls to mean the same thing.  As I painfully discovered, AS/400 
displays frequently crash when attempting to display certain characters 
below x'40', and the problem was a bit mystifying at first.

What I did then, and unfortunately the code is long gone, is to utilize the 
file field descriptions to tell me the from and to positions of each alpha 
field, and then check every byte in every record of the affected 
fields.  In order to check each byte of each field, the field data bytes 
were loaded into an array, and each byte was tested to be sure it was 
greater than or equal to x'40'.  If I were testing zoned numeric bytes, I 
would simply make sure each byte is greater than or equal to '0' and less 
than or equal to '9'.

I suppose the proper mechanism today would be to utilize an API to retrieve 
the field description information, and then use the substring operator to 
pull out each byte and test it.

Perhaps you should consider something similar.  I think it took me less 
than a day to write, test, and use it, and that was on a slow system 38.

At 02:39 PM 1/3/01 -0500, you wrote:
>Aarrgghh!  Foiled again!

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

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.