IBM Support

Sample of a CL Program That Uses the Retrieve Product Information (QSZRTVPR) API

Troubleshooting


Problem

This document provides a sample of using the Retrieve Product Information (QSZRTVPR) API in a CL program on the IBM AS/400, iSeries, System i and POWER Systems products.

Resolving The Problem

The following CL program shows how to code the Retrieve Product Information (QSZRTVPR) API in a CLP.

Caution: The following code example is provided on an unsupported, as is basis.
1.Add source member DSPSLICXPF to the QGPL/QCLSRC source file. On the IBM OS/400, i5/OS, or i command line, type the following:

STRSEU SRCFILE(QGPL/QCLSRC) SRCMBR(DSPSLICXPF) TYPE(CLP) OPTION(2) TEXT('Display SLIC & XPF Release Information')

Press the Enter key.
2.Paste the following CL code into the source and save it:

 BEGIN:      PGM
            DCL        VAR(&RCVR) TYPE(*CHAR) LEN(109)
            DCL        VAR(&RCVRLEN) TYPE(*CHAR) LEN(4) +
                         VALUE(X'0000006D')
            DCL        VAR(&FORMAT) TYPE(*CHAR) LEN(8) +
                         VALUE('PRDR0100')
            DCL        VAR(&SLICPRDINF) TYPE(*CHAR) LEN(27) +
                         VALUE('XXXX999*XXXX 0000*CODE     ')
            DCL        VAR(&XPFPRDINF) TYPE(*CHAR) LEN(27) +
                         VALUE('*OPSYS *CUR  0000*CODE     ')
            DCL        VAR(&ERRCODE) TYPE(*CHAR) LEN(8) +
                         VALUE(X'0000000000000000')
            DCL        VAR(&SLICVRM) TYPE(*CHAR) LEN(6)
            DCL        VAR(&SLICLVL) TYPE(*CHAR) LEN(3)
            DCL        VAR(&XPFVRM) TYPE(*CHAR) LEN(6)
            DCL        VAR(&XPFLVL) TYPE(*CHAR) LEN(3)
            DCL        VAR(&XPFNAME) TYPE(*CHAR) LEN(6)
/* */
            DCL        VAR(&MSGID) TYPE(*CHAR) LEN(7) VALUE('CPF9897')
            DCL        VAR(&MSGF) TYPE(*CHAR) LEN(10) +
                         VALUE('QCPFMSG   ')
            DCL        VAR(&MSGFLIB) TYPE(*CHAR) LEN(10) +
                         VALUE('*LIBL     ')
            DCL        VAR(&MSGDTA) TYPE(*CHAR) LEN(2000)
            DCL        VAR(&TOMSGQ) TYPE(*CHAR) LEN(10) +
                         VALUE('*TOPGMQ   ')
            DCL        VAR(&MSGTYPE) TYPE(*CHAR) LEN(10) +
                         VALUE('*INFO     ')
/* */
            MONMSG     MSGID(CPC0000 CPD0000 CPF0000 MCH0000) +
                         EXEC(GOTO CMDLBL(ERROR))

/* Retrieve IBM OS/400, IBM i5/OS or IBM i (XPF) Release Information */

            CALL       PGM(QSZRTVPR) PARM(&RCVR &RCVRLEN &FORMAT +
                         &XPFPRDINF &ERRCODE)
            CHGVAR     VAR(&XPFVRM) VALUE(%SST(&RCVR 20 6))
            CHGVAR     VAR(&XPFLVL) VALUE(%SST(&RCVR 106 3))
            CHGVAR     VAR(%SST(&SLICPRDINF 1 4)) VALUE(%SST(&RCVR +
                         13 4))
            IF         COND(&XPFVRM < 'V3R6') THEN(CHGVAR +
                         VAR(%SST(&SLICPRDINF 8 6)) VALUE('*CUR  '))
            ELSE       CMD(CHGVAR VAR(%SST(&SLICPRDINF 8 6)) +
                         VALUE('*ONLY '))
            IF         COND(&XPFVRM < 'V5R3M0') THEN(CHGVAR +
                         VAR(&XPFNAME) VALUE('OS/400'))
            ELSE       CMD(IF COND(&XPFVRM >= 'V5R3M0' & &XPFVRM < +
                         'V6R1M0') THEN(CHGVAR VAR(&XPFNAME) +
                         VALUE('i5/OS ')))
            ELSE       CMD(CHGVAR VAR(&XPFNAME) VALUE('i     '))

/* Retrieve IBM System Licensed Internal Code (SLIC) Release Information */

            CALL       PGM(QSZRTVPR) PARM(&RCVR &RCVRLEN &FORMAT +
                         &SLICPRDINF &ERRCODE)
            CHGVAR     VAR(&SLICVRM) VALUE(%SST(&RCVR 20 6))
            CHGVAR     VAR(&SLICLVL) VALUE(%SST(&RCVR 106 3))

/* Write the information on line 24 of the workstation */

            IF         COND(&XPFVRM < 'V4R2M0') THEN(CHGVAR +
                         VAR(&MSGDTA) VALUE('IBM System Licensed +
                         Internal Code: ' || &SLICVRM || ' | ' || +
                         'IBM ' || &XPFNAME |< ': ' || &XPFVRM || +
                         '.'))
            ELSE       CMD(CHGVAR VAR(&MSGDTA) VALUE('IBM System +
                         Licensed Internal Code: ' || &SLICVRM || +
                         '-' || &SLICLVL || ' | ' || 'IBM ' || +
                         &XPFNAME |< ': ' || &XPFVRM || '-' || +
                         &XPFLVL || '.'))
            GOTO       CMDLBL(END)
/* */
ERROR:      RCVMSG     RMV(*YES) MSGDTA(&MSGDTA) MSGID(&MSGID) +
                         MSGF(&MSGF) MSGFLIB(&MSGFLIB)
            CHGVAR     VAR(&MSGTYPE) VALUE('*ESCAPE   ')
                                                                   
END:        SNDPGMMSG  MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +
                         MSGDTA(&MSGDTA) TOMSGQ(&TOMSGQ) +
                         MSGTYPE(&MSGTYPE)
            ENDPGM
3.Compile the CL procedure DSPSLICXPF into the QGPL library. On the IBM OS/400, i5/OS or i command line type the following:

CRTCLPGM PGM(QGPL/DSPSLICXPF) SRCFILE(QGPL/QCLSRC) LOG(*NO)

Press the Enter key.
4.Run the program:

CALL PGM(QGPL/DSPSLICXPF)

Press the Enter key.
5.Once it finished, you will see the System Licensed Internal Code and Operating System release information:

===> _________________________________________________________________________
IBM System Licensed Internal Code: V4R5M0-L00 | IBM OS/400: V4R5M0-L00.


This code example is compatible with the following operating system releases:

o IBM OS/400 V2R3Mx, V3RxMx, V4RxMx, V5R1Mx, and V5R2Mx
o IBM i5/OS V5R3Mx, V5R4Mx
o IBM i V6R1M0 and beyond

Note: The minimum OS release required to use this code example is IBM OS/400 V2R3M0.

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]

Historical Number

493105127

Document Information

Modified date:
11 November 2019

UID

nas8N1013573