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



second try to the right list.

--------------------------------------------------
From: "D*B" <dieter.bender@xxxxxxxxxxxx>
Sent: Friday, February 23, 2018 7:16 AM
To: "RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
Subject: Re: On Triggers and library lists.

Hi Craig,

locating database ressources by library list isn't a good idea at all...
In your case there are good news at the starting point: trigger programms are located by their qualified name! If you specify *LIBL at ADDPFTRG, the lib is resolved and the quaified programm is addded (you could verify this by DSPFD). One easy strategy to follow (I'm going this route with ArdGate, where I can't controll the libl at all) is make it all selfcontained:
- put the trigger programm in the same lib as the file it is added to
- put all ressources the trigger needs, in the same library (programms to call, SRVPGMS it's using...), the files it's writing to
- write the trigger in RPG (as it's runtime knows where it's coming from => programm status datastructure PSDS is your friend)
- it's enough to look once at beginning where you are coming from (minimal overhead!!!)
- call all dependent programms qualified
- SRVPGMs are a little bit tricky to handle, if you are binding qualified, you would need diffrent bindings for prod and test and ..., if youu bind by libl, it could be corrupted by environment. Best is, to bind qualified at runtime, it's done by some APIs, you could have a look to ArdGate how it is done (it's open source, available at SourceForge - look at PROCP4NAME and how it is used in JDBCGATE)
- use SQL for all I/O operations and qualify in all statements.

D*B


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.