Did you check the library list with the following SQL statement? Or how did you check it?
CL: dsplibl output(*print);
Thomas.
-----Ursprüngliche Nachricht-----
Von: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> Im Auftrag von Martijn van Breden
Gesendet: Freitag, 18. November 2022 17:34
An: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Betreff: RE: SQL wrapper around service program
Hi Birgitta and Daniel
Thank you for your quick responses. I am aware that in ACS you have a choice in naming conventions which differs from 5250 by default, that's why I put them to *SYS.
Both
values(current path);
and
values(current schema);
give *LIBL as a result.
I checked the library list (over and over again...) and looked in SYSPROCS and SYSROUTINES for anomalies but couldn't find anything.
Kind regards
Martijn van Breden
lead software architect
-----Oorspronkelijk bericht-----
Van: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> Namens Birgitta Hauser
Verzonden: vrijdag 18 november 2022 17:06
Aan: 'RPG programming on IBM i' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Onderwerp: RE: SQL wrapper around service program
In ACS are you using SQL or System Naming Conventions.
STRSQL and Green Screen uses per default System Naming conventions, so the library list is searched for all (database) objects accessed with SQL.
When using SQL Naming conventions the Library List is not searched.
Unqualified specified tables and views are searched in the default schema (can be set with SET CURRENT SCHEMA - but is not the same as the *CURLIB).
Unqualified specified Stored Procedures, User Defined Functions, User Defined Table Functions are searched in the SQL path, which can be set with SET CURRENT PATH. In the CURRENT PATH multiple schemas separated by a comma can be specified and even the special value *LIBL is allowed.
In either way, make sure you use the same naming conventions when generating and running the routines.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
Modernization - Education - Consulting on IBM i
"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!"
"Train people well enough so they can leave, treat them well enough so they don't want to." (Richard Branson)
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Martijn van Breden
Sent: Freitag, 18. November 2022 16:12
To: RPG400-L@xxxxxxxxxxxxxxxxxx
Subject: SQL wrapper around service program
Hi All
I've been reading on this list for quite a while and it has brought me a lot of knowledge for which I would like to thank you all!
Having said that I ran up to a problem for which I really don't see what to research next and where the cause of the problem even lies.
I have a service program written in SQLRPGLE with at this moment 2 subprocedures. I'd like to call one of them via a stored procedure wrapper so I can use that in my SQL. I did that before with another RPGLE service program and it worked fine at the first attempt. The service program is in PWSLIB, as is the stored procedure.
The stored procedure:
create or replace procedure DVLTMF_SetHash
-- Stelt de hashcode in DVLTMF in.
(in WSLIB_pmx char(10))
program type sub
language rpgle
not deterministic
specific DVLTMS04
not fenced
no sql
external name PWSS_HSH(PWSHSH_SET_MSHSH)
parameter style general
;
The service program exists, the subprocedure is there. I can call the subprocedure from RPG. I can *also* call the stored procedure from STRSQL in a 5250 session which really strikes me.
call dvltmf_sethash('DRGPWS81');
With the same library list in ACS I get this error
SQL-status: 42724 Leverancierscode: -444 Bericht: [SQL0444] External program
*N in *N not found. Oorzaak . . . . : An attempt was made to CALL
procedure or invoke function DVLTMF_SETHASH in PWSLIB. External program or
service program *N in schema *N was not found. Recovery . . . : The
external program or service program associated with the procedure or function cannot be found. Ensure that an object exists with the name specified on the DECLARE PROCEDURE, CREATE PROCEDURE, CREATE FUNCTION, ALTER PROCEDURE, or ALTER FUNCTION statement. If no name was specified, ensure that an object with a name which matches the procedure or function name specified exists. If a program name was specified, a program object must exist. If an entry point name was specified, then a service program object must exist. Try the request again.
I can call the stored procedure unqualified because PWSLIB is in the *libl and I use *SYS naming both in 5250 and ACS.
So I presume that there is something wrong in ACS, but just can't point my finger to what that would be.
Does anyone have a suggestion?
Kind regards,
Martijn van Breden
lead software architect
--
[cid:image001.png@01D8FB65.B0151530]
Pantheon Automatisering B.V.
Heerenveen
Postadres
Abe Lenstra Boulevard 30
8448 JB Heerenveen
T. 0513 657 357
M. 06 2075 2931
info@xxxxxxxxxxxxxxxxxxxxxxxxxx<mailto:info@xxxxxxxxxxxxxxxxxxxxxxxxxx>
https://smex-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=www.pantheon%2dautomatisering.nl&umid=516734f3-7351-405e-879e-5b20367b52f1&auth=b4fb192f9f562222d4db9a38ec07312d437b68fd-d3b1768a6955c1fc803776bad458dfebc5b833b3<
https://smex-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fwww.pantheon%2dautomatisering.nl&umid=516734f3-7351-405e-879e-5b20367b52f1&auth=b4fb192f9f562222d4db9a38ec07312d437b68fd-9f7c03b35b43a8405ae4c844362fc083b11e6583>
KvK 01055135
E-mail disclaimer<
https://smex-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fwww.pantheon%2dautomatisering.nl%2fdisclaimer%2f&umid=516734f3-7351-405e-879e-5b20367b52f1&auth=b4fb192f9f562222d4db9a38ec07312d437b68fd-4187ba0167a81b3116a2e76a812d10146389dc4a>
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.