Function SET182A OPNQRYF wildcard search

LANSA

Function SET182A OPNQRYF wildcard search

********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_182);
********** COMMENT(Function .......: SET182A);
********** COMMENT(Created on .....: 13/07/00 at 14:43:32);
********** COMMENT(Description ....: OPNQRYF wildcard search);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: The purpose of this function is to);
********** COMMENT(show how to do a wildcard search using OPNQRYF.);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as an);
********** COMMENT(example only. No warranty is expressed or implied.);
********** COMMENT();
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT *NOMESSAGES);
********** COMMENT(Define Fields:);
DEFINE FIELD(#S_NAME) REFFLD(#SURNAME) DESC('Get SURNAME containing');
DEFINE FIELD(#S_QRYSLT) TYPE(*CHAR) LENGTH(256);
********** COMMENT(Define browselist:);
DEF_LIST NAME(#S_LST182) FIELDS((#EMPNO)(#SURNAME)(#GIVENAME));
BEGIN_LOOP;
REQUEST FIELDS(#S_NAME) IDENTIFY(*DESC) BROWSELIST(#S_LST182);
CLR_LIST NAMED(#S_LST182);
USE BUILTIN(TCONCAT) WITH_ARGS('SURNAME *EQ %WLDCRD("*' #S_NAME '*")') TO_GET(#S_QRYSLT);
OPEN FILE(PSLMST) USE_OPTION(UOQ) QRYSLT(#S_QRYSLT);
SELECT FIELDS(#S_LST182) FROM_FILE(PSLMST);
ADD_ENTRY TO_LIST(#S_LST182);
ENDSELECT;
END_LOOP;