9.94 GET_LICENSE_STATUS

Note: Built-In Function Rules     Usage Options

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.

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

N

Opt

License status as at Date (YYYYMMDD)
If this argument is not provided or it is zero, today's date will be used.

8

8

0

0

2

A

Opt

Status of this license code is requested. If this argument is not provided, the status of all licenses as at argument1 date will be returned. (*)

3

3

 

 

3

A

Opt

License Version (*)

If this argument is not provided or is blank, a license version of "1" will be assumed.

1

1

0

0

4

A

Opt

Long License Code to check (*)

24

24

0

0

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

L

Req

Working List to contain the license statuses. (*)

*

*

0

0

2

A

Opt

Return code.

OK = list returned partially or completely filled with license status. No more fields exist beyond those returned in the list.

OV = list returned completely filled, but more entries than could fit in the list exist. 

2

2

 

 

 

(*)  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:

From

To

Description

1

3

License Code

4

4

Status Y/N.
Y = License is valid for this machine as at the date used from argument 1.

 

     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:

From

To

Description

1

24

License Code

25

25

Status Y/N.
Y = License is valid for this machine as at the date used from argument 1.

 

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)