SET219F

LANSA

SET219F
* =======================================================
* Process ........: SET_219
* Function .......: SET219F
* Created on .....: 7th November, 2001
* Description ....: Called example -> Get Employee Detail
* Version.........: 1
* Full Description:
* This function is called by SET219E. As arguments it
* receives a full or partial employee name. It returns
* a list of the employees whose names generically match
* the name supplied.
* =======================================================
* ============== D E F I N I T I O N S ================
* =======================================================
Function Options(*LIGHTUSAGE *DIRECT)
* =======================================================
* ================ M A I N L O G I C ===============
* =======================================================
*
* Get the full or partial name passed by SET219E
*
Execute Subroutine(GET_ALPHA) With_Parms(SURNAME *BLANKS 1 #SURNAME)
*
* Clear the return value list
*
Execute Subroutine(CLEAR_ARGS)
*
* Select all matching employees and return them as
* instance values in a list symbolically named EMPLIST
*
Change Field(#LISTCOUNT) To(0)
Select Fields(#EMPNO #SURNAME #GIVENAME #POSTCODE) From_File(PSLMST2) With_Key(#SURNAME) Generic(*YES)
Change Field(#LISTCOUNT) To('#LISTCOUNT + 1')
Execute Subroutine(SET_ALPHA) With_Parms(EMPLIST EMPNO #LISTCOUNT #EMPNO)
Execute Subroutine(SET_ALPHA) With_Parms(EMPLIST SURNAME #LISTCOUNT #SURNAME)
Execute Subroutine(SET_ALPHA) With_Parms(EMPLIST GIVENAME #LISTCOUNT #GIVENAME)
Execute Subroutine(SET_NUMBER) With_Parms(EMPLIST POSTCODE #LISTCOUNT #POSTCODE)
Endselect
*
* Return the count of how many entries were in the list
*
Execute Subroutine(SET_NUMBER) With_Parms(LISTCOUNT *BLANKS 1 #LISTCOUNT)
*
*
* Finished. Return control to SET219A
*
Return
*
* =======================================================
* ======== C O M M O N S U B R O U T I N E S =========
* =======================================================
* This set of subroutines are simple interfaces to RDML
* function SET219Y. They can be copied from this function
* and used in other similar functions unchanged.
* =======================================================
* -------------------------------------------------------
* Use CLEAR_Args to clear the current set of values
* -------------------------------------------------------
Subroutine Name(CLEAR_ARGS)
Execute Subroutine(CALL_219Y) With_Parms(CLEAR)
Endroutine
* -------------------------------------------------------
* Use SET_ALPHA to pass an alphanumeric value
* -------------------------------------------------------
Subroutine Name(SET_ALPHA) Parms((#S_219NAM1 *RECEIVED) (#S_219NAM2 *RECEIVED) (#S_219NAMI *RECEIVED) (#S_219AVAL *RECEIVED))
Execute Subroutine(CALL_219Y) With_Parms(SETALP)
Endroutine
* -------------------------------------------------------
* Use SET_NUMBER to pass a numeric value
* -------------------------------------------------------
Subroutine Name(SET_NUMBER) Parms((#S_219NAM1 *RECEIVED) (#S_219NAM2 *RECEIVED) (#S_219NAMI *RECEIVED) (#S_219NVAL *RECEIVED))
Execute Subroutine(CALL_219Y) With_Parms(SETNUM)
Endroutine
* -------------------------------------------------------
* Use GET_ALPHA to return an alphanumeric value
* -------------------------------------------------------
Subroutine Name(GET_ALPHA) Parms((#S_219NAM1 *RECEIVED) (#S_219NAM2 *RECEIVED) (#S_219NAMI *RECEIVED) #S_219AVAL)
Execute Subroutine(CALL_219Y) With_Parms(GETALP)
Endroutine
* -------------------------------------------------------
* CALL_219Y is used to consolidate calls to SET219Y
* -------------------------------------------------------
Subroutine Name(CALL_219Y) Parms((#S_219OPER *RECEIVED))
Exchange Fields(#S_219OPER #S_219NAM1 #S_219NAM2 #S_219NAMI #S_219AVAL #S_219NVAL #S_219HOST #S_219FUNC)
Call Process(*DIRECT) Function(SET219Y)
Endroutine