Hi, Paul,
Very nice detailed reply. :-)
The answer to your question about "where that procedure comes from" is found on this page:
https://www.ibm.com/support/pages/example-using-dlpargetinfo-api-get-numerical-partition-id-logical-partition-lpar
This CL program must be "CLLE" (ILE CL), created with CRTCLMOD, and then bound with BNDSRVPGM(*LIBL/QPMLPMGT) specified on the CRTBNDPGM command. So, the procedure "dlpar_get_info" is contained in the *SRVPGM named QPMLPMGT in QSYS.
You can verify this by issuing:
DSPSRVPGM QPMLPMGT
and then pressing Enter four times, until you get to "Display 5 of 10" where you can see the names of the procedures exported by this *SRVPGM.
For more details of other information you can retrieve using "dlpar_get_info" see:
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_71/apis/dlpar_get_info.htm
I hope that helps to clarify somewhat?
All the best,
Mark S. Waterbury
On Wednesday, February 3, 2021, 11:31:47 PM EST, PaulMmn <paulmmn@xxxxxxxxxxxxx> wrote:
Mark,
We've been using this little program every since we moved our
computer to LPARs at least 6 years ago-- and added a program that
uses that technique around then.
Many of our programs check to see if they're on our production or
test system. We used to retrieve the system serial number. This
fails on an LPAR-- all of the systems have the same serial number!
We modified this program to return the system serial number (7 chars)
concatenated with a single digit for LPAR ID#. Since our systems
compare the retrieved 'serial number' with a data area, changing
things for new hardware is a snap!
of course, if we ever get more than 9 iSeries LPARS, all bets are off...
One question I have-- where does this 'dlpar_get_info' come from? Is
that a system-level procedure?
--Paul E Musselman
At 7:43 PM +0000 2/3/21, Mark Waterbury wrote:
James,
If you just want to know the LPAR #, you can use this little CL program:
PGM
DCL VAR(&RECEIVER) TYPE(*CHAR) LEN(256)
DCL VAR(&FORMAT) TYPE(*CHAR) LEN(4) VALUE(X'00000001')
DCL VAR(&SIZE) TYPE(*CHAR) LEN(4) VALUE(X'00000100')
DCL VAR(&LPARNBR) TYPE(*CHAR) LEN(10)
CALLPRC PRC('dlpar_get_info') PARM((&RECEIVER) +
(&FORMAT *BYVAL) (&SIZE *BYVAL))
CHGVAR VAR(&LPARNBR) VALUE(%BIN(&RECEIVER 41 4))
SNDPGMMSG MSG(&LPARNBR) TOPGMQ(*EXT)
ENDPGM
Hope that helps,
Mark S. Waterbury
As an Amazon Associate we earn from qualifying purchases.