Mark, as far as I know - thee are no API i/f to license information; so you have basically two options:
- rely on your awk skills to parse output of db2licm -l command :-)
- parse info from nodelock:
db2inst1@Tablecik:~$ cat /opt/ibm/db2/V12.1/license/nodelock
#8196c4de670cedde2419392f2aff4ba1f07242b0ece83939c993d90f62a675b8 DerivedLicenseAggregateDuration=90,DerivedLicenseEndDate=09/25/2025,DerivedLicenseStartDate=06/27/2025,LicenseDuration=90,LicenseEndDate=09/25/2025,LicenseStartDate=06/27/2025,ProductAnnotation=5;(_t),ProductID=1413,ProductName=DB2 Enterprise Server Edition,ProductVersion=12.1,TrialExpDate=1758977583,
fa8c63c6836c9176b8656f8761c0bb85f522bed0fe64e2dbdefc5d2415f3f2fc DerivedLicenseAggregateDuration=90,DerivedLicenseEndDate=09/25/2025,DerivedLicenseStartDate=06/27/2025,LicenseDuration=90,LicenseEndDate=09/25/2025,LicenseStartDate=06/27/2025,ProductAnnotation=5;(_t),ProductID=1404,ProductName=DB2 Advanced Edition,ProductVersion=12.1,TrialExpDate=1759239984,