Generate License Key (GENLICKEY)
| Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Generate License Key (GENLICKEY) command generates a license key to enable users to access a product or a feature of a product. This key is specific to the product and system information entered in this command. The resulting key will be a combination of 18 characters and numbers, A-F and 0-9. To run this command, the product definition of the product you are generating the key for must exist on the system.

This command also adds the license information to the license repository. The keys are saved in the repository to keep a history of all the keys generated. You can display the repository to see what keys were generated for a specific product or system. To work with the license repository, you can use the Display License Key Information (DSPLICKEY), Add License Key Information (ADDLICKEY), and Remove License Key Information (RMVLICKEY) commands.

You can use the Add License Key Information (QLZAADDK) API or the Add Product License Information (QLZADDLI) API to add license information.

Restrictions:

- This command is shipped with exclude (*EXCLUDE) public authority. The QPGMR, QSYSOPR, QSRV, and QSRVBAS user profiles are shipped with private authorities to use this command.
| Top |
Parameters
| Keyword | Description | Choices | Notes |
|---|---|---|---|
| PRDID | Product ID | Character value | Required, Positional 1 |
| LICTRM | License term | Character value | Required, Positional 2 |
| FEATURE | Feature | Character value | Required, Positional 3 |
| VNDPWD | Vendor password | Simple name, *NONE | Required, Positional 4 |
| SERIAL | System serial number | Character value | Required, Positional 5 |
| PRCGRP | Processor group | Character value, *ANY | Optional, Positional 6 |
| EXPDATE | Expiration date | Date, *NONE | Optional |
| USGLMT | Usage limit | 0-999999, 1, *NOMAX | Optional |
| VNDDTA | Vendor data | Character value, *NONE | Optional |
| OUTPUT | Output | *, *PRINT, *LICKEYFILE | Optional |
| LICKEYFILE | License key file | Qualified object name | Optional |
| Qualifier 1: License key file | Name | ||
| Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
| LICKEYMBR | License key member | Element list | Optional |
Element 1: Member to receive output![]() |
Name, *FIRST | ||
| Element 2: Replace or add records | *ADD, *REPLACE |
| Top |
Product ID (PRDID)

Specifies the 7-character identifier of the product for which the license key is to be generated.
| Top |
License term (LICTRM)
Specifies the license term for which license key is to be generated.
The possible values are:
- license-term
- Specify the license term of the product in one of the following two formats:
Specify the license term in Vx, VxRy, or VxRyMz format, where x and y can be a number from 0 through 9, and z can be a number 0 through 9 or a letter A through Z.

Specify the license term in vv, vvrr, or vvrrmm format, where vv and rr can be a number from 00 through 35, and mm can be a number 00 through 09 or a letter 0A through 0Z. This format must be used if the version or release of the product is greater than 9.

| Top |
Feature (FEATURE)
Specifies the feature of the product specified on the PRDID parameter for which the license key is to be generated.
The possible values are:
- feature
- Specify the feature for which a license key is to be generated. Valid values range from 5001 through 9999.

| Top |
Vendor password (VNDPWD)
Specifies the software vendor's password. This password will be encrypted and stored with the product. It is used to validate the generate license key request and must be the same password you use on the Add Product License Information (ADDPRDLICI) command.
The possible values are:
- *NONE
- There is no vendor password needed to generate a license key.
- vendor-password
- Specify the vendor password. It must begin with an alphabetic character (A through Z, $, #, or @) followed by no more than 9 alphanumeric characters (A through Z, 0 through 9, $, #, @, or _).
| Top |
System serial number (SERIAL)
Specify the system serial number of the system the license key is being generated for.
The possible values are:
- system-serial-number
- Specifies the system serial number of the system the license key is being generated for.
| Top |
Processor group (PRCGRP)
Specifies the processor group of the system the license key is being generated for.
The possible values are:
- *ANY
- The license key being generated will work with any processor group.
- processor-group
- Specifies the processor group of the system the license key is being generated for. Use the Work with License Information (WRKLICINF) command on the system the key is being generated for to display the processor group.
| Top |
Expiration date (EXPDATE)
Specifies the date the product license expires. After this date, users over the default usage limit will not be allowed to access the product or feature. A new license key must be obtained from the software vendor to allow further use of the product.
The possible values are:
- *NONE
- There is no expiration date for the product or feature.
- expiration-date
- Specify the date that the product or feature expires.
| Top |
Usage limit (USGLMT)

Specifies the maximum number of users (usage limit) for the product or feature for which the license key is being generated. For concurrent usage, specifies the maximum number of jobs allowed to access the product or feature at the same time. For registered usage, this is the maximum number of license users that can be registered to use this product or feature.
The possible values are:
- 1
- One user is allowed to access the product or feature.
- *NOMAX
- The number of users is not limited.
- usage-limit
- Specifies the maximum number of users for this product or feature. Valid values range from 0 through 999999.
| Top |
Vendor data (VNDDTA)
Specifies an 8-character data field to be defined and used by the vendor.
The possible values are:
- *NONE
- There is no vendor data for this product or feature.
- vendor-data
- Specifies 8-characters that help define further information on the product or feature.
| Top |
Output (OUTPUT)
Specifies whether the license key that is generated is displayed in a completion message, printed in a spooled file, or saved in a file.
The possible values are:
- *
- The license key is only shown in a completion message.
- The license key is printed in a spooled file.
- *LICKEYFILE
- The license key information is saved to the file specified on the LICKEYFILE parameter. This file can then be used as a key file for Distributed Systems License Option (DSLO) media.

| Top |
License key file (LICKEYFILE)

Specifies the file in which the license key information is saved. If this file does not exist, the system creates it. If a new file is created, system file QALZAKEY in system library QSYS with a format name of LZAKEYR is used as a model.
The possible values are:
- *LIBL
- The library list is used to locate the file in which to save the license key.
- *CURLIB
- The current job library is used to locate the file in which to save the license key. If no library is specified as the current library, the QGPL library is used.
- library-name
- Specify the name of the library where the license key is to be saved.
The possible file name value is:
- file-name
- Specify the name of the file into which the license key information is to be saved.
| Top |
License key member (LICKEYMBR)
Specifies which member the license key information is saved into and how the information is saved.
Note:

You can also use the Generate License Key (QLZAGENK) API to create the license key information.
The possible member to receive output values are:
- *FIRST
- The first member in the file receives the output. If LICKEYMBR(*FIRST) is specified and the member does not exist, the system creates a member with the name of the file specified on the LICKEYFILE parameter.
- member-name
- Specify the name of the file member that receives the output. If the name of the file member is specified and the member does not exist, the system creates it. If the member already exists, you have the option of either adding a new record to the end of the existing member or clearing the member and then adding the new records.

The option to perform on member values are:
- *ADD
- If the member exists, the system adds the new record to the end of the existing records.
- *REPLACE
- If the member exists, the system clears it and then adds the new record.
| Top |
Examples
GENLICKEY PRDID(1MYPROD) LICTRM(V1R2M0) FEATURE(5001)
VNDPWD(PRODUCTPWD) EXPDATE(*NONE) SERIAL(1234567) PRCGRP(P30) USGLMT(25)

This command generates a license key for product 1MYPROD, license term V1R2M0 and feature 5001. The key allows 25 users to be authorized to use this product, and there is no expiration date. The key allows the product to only be used on a system with a serial number of 1234567 and a processor group of P30 or less.
| Top |
Error messages

*ESCAPE Messages
- CPF9860
- Error occurred during output file processing.
- CPF9899
- Error occurred during processing of command.

| Top |