I am trying to use QsyFindFirstValidationLstEntry in RPG, however despite being sure of the existence of the validation list I am getting error 3025, which according to documentation means "The validation list object was not found." The only thing that I can think of is that there is a problem on how I try to pass the qualified name over.
According to the documentation:
int QsyFindFirstValidationLstEntry
(Qsy_Qual_Name_T *Validation_Lst,
Qsy_Rtn_Vld_Lst_Ent_T *First_Entry);
where
Validation_Lst (Input)
A pointer to the qualified object name of the validation list to find the first entry in. The first 10 characters specify the validation list name, and the second 10 characters specify the library.
Here is my attempt at calling it from RPG:
H option(*srcstmt: *nodebugio)
H DFTACTGRP(*NO)
/COPY QSYSINC/QRPGLESRC,QUSEC
/COPY QSYSINC/QRPGLESRC,QSYVLDL
/free
DCL-PR FindFstValLstEn INT(10)
EXTPROC('QsyFindFirstValidationLstEntry');
QualName pointer const options(*STRING);
Entry pointer;
END-PR;
DCL-PR errno pointer EXTPROC('__errno');
END-PR;
DCL-DS FirstEntry LikeDS(QSYRVLE) based(fe_ptr);
dcl-s fe_ptr pointer;
DCL-S result INT(10);
dcl-s errno_val INT(10) based(errno_ptr);
dcl-s errno_ptr pointer;
// "WEBUSRS WEBLIB "
dcl-s vldl varchar(20) inz('USERPRF QUSRSYS ');
result = FindFstValLstEn(vldl:fe_ptr);
if (result<>0);
errno_ptr = errno;
dsply errno_val;
endif;
*InLR=*On;
/end-free
As I said this gives me error code 3025 even though the validation list QUSRSYS/USRPRF exists and I am able to read it using QSYOLVLE API.