|
Here's a CL program that will do what you want:
0001.00
0002.00 PGM
0003.00
0004.00 DCL &release *CHAR 6
0005.00
0006.00 /************************************************************ */
0007.00 /* RCVR can be 8 bytes or larger (must be enough to hold the */
0008.00 /* all the fields upto and including the field you want from */
0009.00 /* the PRDR0100 format. */
0010.00 /* X'00000000' for the error code tells the API to signal */
0011.00 /* errors. */
0012.00 /* */
0013.00 /* PRDINFO (Product Information): */
0014.00 /* *OPSYS - The product ID for the operating system is */
0015.00 /* used. */
0016.00 /* *CUR - Use the release of the currently installed */
0017.00 /* system */
0018.00 /* 0000 - Base option */
0019.00 /* *CODE - Use load ID for the given prod ID, release */
0020.00 /* level, and option. */
0021.00 /* */
0022.00 /* */
0023.00 /************************************************************ */
0024.00 DCL &rcvr *CHAR 128
0025.00 DCL &rcvrlen *CHAR 4 VALUE(X'00000080')
0026.00 DCL &format *CHAR 8 VALUE('PRDR0100')
0027.00 DCL &prdinfo *CHAR 27 VALUE('*OPSYS *CUR 0000*CODE -
0028.00 ')
0029.00 DCL &errcode *CHAR 4 VALUE(X'00000000')
0030.00
0031.00 CALL QSYS/QSZRTVPR PARM(&rcvr &rcvrlen &format &prdinfo &errcode)
0032.00
0033.00 CHGVAR &release (%SST(&rcvr 20 6))
0034.00 SNDPGMMSG MSG('This system is at release' |> &release)
0035.00 ENDPGM
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.