JSMLR0B LANSAタイプ情報
FUNCTION OPTIONS(*DIRECT)
**********
DEFINE FIELD(#JSMSTS) TYPE(*CHAR) LENGTH(20)
DEFINE FIELD(#JSMMSG) TYPE(*CHAR) LENGTH(255)
DEFINE FIELD(#JSMCMD) TYPE(*CHAR) LENGTH(255)
**********
DEFINE FIELD(#BNDMAPS) TYPE(*CHAR) LENGTH(10)
DEFINE FIELD(#BNDMAPL) TYPE(*CHAR) LENGTH(30)
**********
DEF_LIST NAME(#MAPLST) FIELDS((#BNDMAPS) (#BNDMAPL)) TYPE(*WORKING)
**********
DEF_LIST NAME(#TYPTABLE) FIELDS((#BNDECDE) (#BNDESEQ) (#BNDENME) (#BNDEETY) (#BNDEDSC) (#BNDSCDE) (#BNDSTYP) (#BNDSARY) (#BNDCCDE) (#BNDCTYP) (#BNDCARY)) TYPE(*WORKING) ENTRYS(300)
**********
********** Build field/column map
**********
EXECUTE SUBROUTINE(BLDMAP)
**********
********** Open service
**********
USE BUILTIN(JSM_OPEN) TO_GET(#JSMSTS #JSMMSG)
EXECUTE SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
********** Load service
**********
CHANGE FIELD(#JSMCMD) TO('SERVICE_LOAD SERVICE(RFIDataSourceService) SERVICE_LIST(BNDMAPS,BNDMAPL) BIND(*FIELD) TRACE(*NO)')
USE BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG #MAPLST)
EXECUTE SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
********** Create datasource
**********
USE BUILTIN(JSM_COMMAND) WITH_ARGS('CREATE DATASOURCE(REPOSITORY)') TO_GET(#JSMSTS #JSMMSG)
EXECUTE SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
SELECT FIELDS((#BNDESEQ) (#BNDEDSC) (#BNDSCDE) (#BNDCCDE) (#BNDCARY) (#BNDENME) (#BNDEETY)) FROM_FILE(BNDETPS) WITH_KEY(#BNDGCDE #BNDECDE)
**********
IF COND('#BNDSCDE *NE *BLANK')
**********
********** Simple Type
**********
CHANGE FIELD(#BNDCARY) TO('N')
CHANGE FIELD(#BNDCCDE) TO(*BLANK)
CHANGE FIELD(#BNDCTYP) TO(*BLANK)
**********
FETCH FIELDS((#BNDSDSC) (#BNDSTYP) (#BNDSARY) (#BNDSNME) (#BNDSETY)) FROM_FILE(BNDSTPS) WITH_KEY(#BNDGCDE #BNDSCDE)
**********
********** Inherit simple name
**********
IF COND('#BNDENME *EQ *BLANK')
CHANGE FIELD(#BNDENME) TO(#BNDSNME)
ENDIF
**********
********** Inherit simple description
**********
IF COND('#BNDEDSC *EQ *BLANK')
CHANGE FIELD(#BNDEDSC) TO(#BNDSDSC)
ENDIF
**********
********** Inherit simple field
**********
IF COND('#BNDEETY *EQ *BLANK')
CHANGE FIELD(#BNDEETY) TO(#BNDSETY)
ENDIF
**********
ENDIF
**********
IF COND('#BNDCCDE *NE *BLANK')
**********
********** Complex Type
**********
CHANGE FIELD(#BNDSARY) TO('N')
CHANGE FIELD(#BNDSCDE) TO(*BLANK)
CHANGE FIELD(#BNDSTYP) TO(*BLANK)
**********
FETCH FIELDS((#BNDCDSC) (#BNDCTYP)) FROM_FILE(BNDCTPS) WITH_KEY(#BNDGCDE #BNDCCDE)
**********
********** Inherit complex description
**********
IF COND('#BNDEDSC *EQ *BLANK')
CHANGE FIELD(#BNDEDSC) TO(#BNDCDSC)
ENDIF
**********
ENDIF
**********
IF COND('#BNDENME *EQ *BLANK')
CHANGE FIELD(#BNDENME) TO('NONAME')
ENDIF
**********
ADD_ENTRY TO_LIST(#TYPTABLE)
**********
CHANGE FIELD(#BNDESEQ) TO(*DEFAULT)
CHANGE FIELD(#BNDEDSC) TO(*DEFAULT)
CHANGE FIELD(#BNDENME) TO(*DEFAULT)
CHANGE FIELD(#BNDEETY) TO(*DEFAULT)
**********
CHANGE FIELD(#BNDSCDE) TO(*DEFAULT)
CHANGE FIELD(#BNDSDSC) TO(*DEFAULT)
CHANGE FIELD(#BNDSTYP) TO(*DEFAULT)
CHANGE FIELD(#BNDSARY) TO(*DEFAULT)
CHANGE FIELD(#BNDSNME) TO(*DEFAULT)
CHANGE FIELD(#BNDSETY) TO(*DEFAULT)
**********
CHANGE FIELD(#BNDCCDE) TO(*DEFAULT)
CHANGE FIELD(#BNDCDSC) TO(*DEFAULT)
CHANGE FIELD(#BNDCTYP) TO(*DEFAULT)
CHANGE FIELD(#BNDCARY) TO(*DEFAULT)
**********
ENDSELECT
**********
CHANGE FIELD(#JSMCMD) TO('PUT OBJECT(*TABLE) NAME(TYPE_ELEMENT_LIST) SERVICE_LIST(BNDECDE,BNDESEQ,BNDENME,BNDEETY,BNDEDSC,BNDSCDE,BNDSTYP,BNDSARY,BNDCCDE,BNDCTYP,BNDCARY)')
USE BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG #TYPTABLE)
EXECUTE SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
********** Send datasource
**********
USE BUILTIN(JSM_COMMAND) WITH_ARGS('SEND OBJECT(*DATASOURCE)') TO_GET(#JSMSTS #JSMMSG)
EXECUTE SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
********** Close service and send the HTTP response
**********
USE BUILTIN(JSM_CLOSE) TO_GET(#JSMSTS #JSMMSG)
EXECUTE SUBROUTINE(CHECK) WITH_PARMS(#JSMSTS #JSMMSG)
**********
********** SUB ROUTINES
**********
SUBROUTINE NAME(CHECK) PARMS((#JSMSTS *RECEIVED) (#JSMMSG *RECEIVED))
**********
IF COND('#JSMSTS *NE OK')
**********
********** Close service
**********
USE BUILTIN(JSM_CLOSE) TO_GET(#JSMSTS #JSMMSG)
**********
ENDIF
**********
ENDROUTINE
**********
SUBROUTINE NAME(BLDMAP)
**********
CHANGE FIELD(#BNDMAPS) TO(BNDECDE)
CHANGE FIELD(#BNDMAPL) TO(TYPE_KEY)
ADD_ENTRY TO_LIST(#MAPLST)
**********
CHANGE FIELD(#BNDMAPS) TO(BNDESEQ)
CHANGE FIELD(#BNDMAPL) TO(SEQUENCE)
ADD_ENTRY TO_LIST(#MAPLST)
**********
CHANGE FIELD(#BNDMAPS) TO(BNDENME)
CHANGE FIELD(#BNDMAPL) TO(NAME)
ADD_ENTRY TO_LIST(#MAPLST)
**********
CHANGE FIELD(#BNDMAPS) TO(BNDEETY)
CHANGE FIELD(#BNDMAPL) TO(ENTITY)
ADD_ENTRY TO_LIST(#MAPLST)
**********
CHANGE FIELD(#BNDMAPS) TO(BNDEDSC)
CHANGE FIELD(#BNDMAPL) TO(DESC)
ADD_ENTRY TO_LIST(#MAPLST)
**********
CHANGE FIELD(#BNDMAPS) TO(BNDSCDE)
CHANGE FIELD(#BNDMAPL) TO(SIMPLE_CODE)
ADD_ENTRY TO_LIST(#MAPLST)
**********
CHANGE FIELD(#BNDMAPS) TO(BNDSTYP)
CHANGE FIELD(#BNDMAPL) TO(SIMPLE_TYPE)
ADD_ENTRY TO_LIST(#MAPLST)
**********
CHANGE FIELD(#BNDMAPS) TO(BNDSARY)
CHANGE FIELD(#BNDMAPL) TO(SIMPLE_ARRAY)
ADD_ENTRY TO_LIST(#MAPLST)
**********
CHANGE FIELD(#BNDMAPS) TO(BNDCCDE)
CHANGE FIELD(#BNDMAPL) TO(COMPLEX_CODE)
ADD_ENTRY TO_LIST(#MAPLST)
**********
CHANGE FIELD(#BNDMAPS) TO(BNDCTYP)
CHANGE FIELD(#BNDMAPL) TO(COMPLEX_TYPE)
ADD_ENTRY TO_LIST(#MAPLST)
**********
CHANGE FIELD(#BNDMAPS) TO(BNDCARY)
CHANGE FIELD(#BNDMAPL) TO(COMPLEX_ARRAY)
ADD_ENTRY TO_LIST(#MAPLST)
**********
ENDROUTINE