× 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 Frederik,

it depends very well on what you have right now, and what you want in the future.

I would probably externalize the checking procedure into a service program - this makes it easy, to import it in ILE-RPG and on the other side is easy to create a SQL procedure/function for the same task.

Now you have to think about some design decisions:

1. How to pass the data into the procedure?

a) simply send the whole DSPF record format of the screen
which makes it easy for RPG but hard for other programs

b) you can pass the whole table record format
also easy in RPG and not so hard in other languages but still not easy

c) you can pass the data "one-check-at-a-time"
I mean you call it for each field with field name and value
easy in RPG and easy in other languages

d) you can pass the data to check using a JSON or XML string
not so easy in RPG- but not so hard - easy in most other languages

2. How to communicate the "errors" back?

a) message file ids would be a good idea
you can send back a list-like string
"MSG4711, MSG0815, MSG..."

b) send messages into the job log and extract from there

c) communicate a JSON or XML string back

It's quite hard, to get into more details, without knowing how your current system is designed and how the new system should look like.

But maybe these ideas give you something to think about.

HTH
Daniel


Am 17.06.2024 um 12:13 schrieb Frederik Vanderhaeghe via RPG400-L <rpg400-l@xxxxxxxxxxxxxxxxxx>:

Hello,

We have a client screen with the program behind it to do the validation and such. A normal RPGLE progam ;-).

But, as things become a bit more modern, we can get client information from other ways than just input via the screen. Via a webform, JSON file, ...

In order not to write the same validations everytime, we would like to make a seperate validation program that's used by each of these input methods.

Has anyone done anything like this before?
If so, how did you approach this? How do you give the errors back and how do you handle them to show the correct errors on the screen...

Kind regards,
Frederik

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.