9.114 GET_LICENSE_STATUS
Retrieve the status of LANSA licenses in this LANSA system as at a particular date.
Running a regularly scheduled job using this Built-In Function can provide advance warning of a license about to expire.
Þ This is a Specialized Built-In Function for use in a Development Environment only.
For use with
|
Arguments
|
Return Values
|
(*) When License Version is set to "1", the 4th argument, if specified, is ignored. The calling RDML function must provide a working list with an aggregate entry length of exactly 4 bytes and with no more than 9999 entries. Each returned list entry is formatted as follows:
|
When License Version is set to "2", the 2nd argument is ignored and the 4th argument, if specified, is used as the license code whose status is requested. The calling RDML function must provide a working list with an aggregate entry length of exactly 25 bytes and with no more than 9999 entries. Each returned list entry is formatted as follows:
|
Technical Notes
IBM i licenses: The license codes return will contain this LANSA system's permanent licenses plus LANSA Integrator key licenses where Integrator has been installed or upgraded using the IBM i installation processing. Where LANSA Integrator has been installed separately, the Integrator licenses will not be returned by GET_LICENSE_STATUS.
Example
To find licenses which are currently valid but will expire in the next month.
DEFINE FIELD(#CODE1) TYPE(*CHAR) LENGTH(3)
DEFINE FIELD(#CODE2) TYPE(*CHAR) LENGTH(3)
DEFINE FIELD(#STATUS1) TYPE(*CHAR) LENGTH(1)
DEFINE FIELD(#STATUS2) TYPE(*CHAR) LENGTH(1)
DEF_LIST NAME(#WLIST1) FIELDS((#CODE1) (#STATUS1)) TYPE(*WORKING
)
DEF_LIST NAME(#WLIST2) FIELDS((#CODE2) (#STATUS2)) TYPE(*WORKING
)
DEF_LIST NAME(#BLIST) FIELDS((#CODE2) (#STATUS2))
DEFINE FIELD(#EXPDATE) TYPE(*DEC) LENGTH(8) DECIMALS(0)
DEFINE FIELD(#YESTERDAY) TYPE(*DEC) LENGTH(8) DECIMALS(0)
DEFINE FIELD(#RETCODE) TYPE(*CHAR) LENGTH(2)
********** Today + 31 days : to get licenses which will expire
********** next month
USE BUILTIN(FINDDATE) WITH_ARGS(#YYYYMMDD 31 J J) TO_GET(#E
XPDATE)
********** WLIST2 will contain license status in 31 days time.
CLR_LIST #wlist2
USE BUILTIN(GET_LICENSE_STATUS) WITH_ARGS(#EXPDATE) TO_GET(
#WLIST2)
********** Today - 1 day : to get yesterday's date
USE BUILTIN(FINDDATE) WITH_ARGS(#YYYYMMDD -1 J J) TO_GET(#Y
ESTERDAY)
********** WLIST1 will contain license status yesterday.
CLR_LIST #wlist1
USE BUILTIN(GET_LICENSE_STATUS) WITH_ARGS(#YESTERDAY) TO_GE
T(#WLIST1)
********** Compare the status in a month's time with the status
********** yesterday to find licenses which will expire in the
********** next month.
CLR_LIST #blist
SELECTLIST #wlist2
IF COND('#status2 = N')
LOC_ENTRY IN_LIST(#WLIST1) WHERE('#code1 = #code2')
IF COND('(#IO$STS = OK) *AND (#STATUS1 = Y)')
ADD_ENTRY #BLIST
ENDIF
ENDIF
ENDSELECT
DISPLAY FIELDS((#EXPDATE)) BROWSELIST(#BLIST)