× 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 would suggest the defining data rules in a display file DDS is
probably not the best solution. Maybe you'd possibly consider using
Check constraints on the database itself... you can use the CL command
ADDPFCST.

Using the constraints, the database is more protected in that data is
checked for the correct value regardless of the source of the data. The
same rules will be in effect on a green screen application, and through
SQL interfaces also...

That said... It's a bit difficult in your RPG or COBOL program to
determine exactly what constraint(data rule) is being broken when
someone tries to modify the field to an incorrect value... As I recall,
you just get an I-O error with a Maj/Min code and error message that
says "attempted violation of a constraint"... it does not tell you which
one... unless they've made it more clear since I used them.

But... in any event, I would caution against setting data rules in
display files, or physical files for that matter.... They tend to get
lost, and are a problem to find when you're looking for them... 

Dan Riehl  
The PowerTech Group, Inc.
.

>> 
>> I'm currently looking through the DDS manual, trying to
>> work out a way for a 2-character alphanumeric field to
>> accept "A", "C", "X", or a digit from 1 to 9 (in either
>> column, with the other column blank), or any 2-digit
>> number from "01" to "99", and reject any other entry.
>> Preferably doing all the validation within the display
>> file.
>> 
>> I noticed that the "VALUES" keyword can only accommodate
>> 100 values, and that wouldn't be enough to cover every
>> valid value individually.
>> 
>> Can anybody suggest something I may be overlooking? Or
>> tell me outright that it's impossible, and that I need to
>> do the validation in the program?


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.