Note: Built-In Function Rules Usage Options
Retrieves a list of processes and their descriptions from the LANSA internal database and returns them to the calling RDML function in a variable length, working list
This is a Specialized Built-In Function for use in a Development Environment only.
Arguments
|
Return Values
|
Example
A program can be created, using this function, to compile a series of processes in an overnight job.
FUNCTION OPTIONS(*DIRECT)
DEFINE FIELD(#STARTPRC) REFFLD(#PROCESS) DESC('Start Search with:')
DEFINE FIELD(#LASTPRC) REFFLD(#PROCESS) DESC('Last retrieved:')
DEFINE FIELD(#SPARE) REFFLD(#PROCESS)
OVERRIDE FIELD(#STD_INSTR) COLHDG('Name (Description)')
OVERRIDE FIELD(#STD_CMPAR) DESC('Return Code (OV,OK or NR)')
DEF_LIST NAME(#PRCLST) FIELDS(#PROCESS #PARTDESC #SPARE) TYPE(*WORKING) ENTRYS(14)
DEF_LIST NAME(#BRWLST) FIELDS((#STD_INSTR *NOID))
*
CHANGE FIELD(#LASTPRC #STD_CMPAR) TO(*BLANKS)
*
BEGIN_LOOP
REQUEST FIELDS(#STARTPRC #LASTPRC (#STD_CMPAR *OUT)) IDENTIFY(*DESC) BROWSELIST(#BRWLST)
IF COND('#lastprc *ne #blanks')
CHANGE FIELD(#STARTPRC) TO(#lastprc)
ENDIF
CLR_LIST NAMED(#PRCLST)
USE BUILTIN(GET_PROCESS_LIST) WITH_ARGS(#STARTPRC) TO_GET(#PRCLST #LASTPRC #STD_CMPAR)
CASE OF_FIELD(#STD_CMPAR)
WHEN VALUE_IS('= OV')
CLR_LIST NAMED(#BRWLST)
SELECTLIST NAMED(#PRCLST)
USE BUILTIN(BCONCAT) WITH_ARGS(#PROCESS '(' #PARTDESC ')') TO_GET(#STD_INSTR)
ADD_ENTRY TO_LIST(#BRWLST)
ENDSELECT
WHEN VALUE_IS('= OK')
MESSAGE MSGTXT('No more matching process names')
CHANGE FIELD(#LASTPRC) TO(#BLANKS)
WHEN VALUE_IS('= ER')
MESSAGE MSGTXT('No process names matching search')
ENDCASE
END_LOOP