Retrieving numeric partition ID in SQL

Michael Mayer via MIDRANGE-L <[email protected]> Thu, 30 Jul 2026 12:58:59 +0000
Newsgroups gmane.comp.hardware.ibm.midrange
Message-ID <CH2PR12MB4103781C9162CE88CEE484E3AAC92@CH2PR12MB4103.namprd12.prod.outlook.com>
Dan, try this .... I think this gets you what you want.
If not - I tried!
MM


SELECT
  (SELECT VARCHAR(CURRENT_CHARACTER_VALUE, 10)
   FROM QSYS2.SYSTEM_VALUE_INFO
   WHERE SYSTEM_VALUE_NAME = 'QSRLNBR') AS SERIAL_NUMBER,

  (SELECT VARCHAR(CURRENT_CHARACTER_VALUE, 10)
   FROM QSYS2.SYSTEM_VALUE_INFO
   WHERE SYSTEM_VALUE_NAME = 'QMODEL') AS SYSTEM_MODEL,

  (SELECT VARCHAR(CURRENT_CHARACTER_VALUE, 10)
   FROM QSYS2.SYSTEM_VALUE_INFO
   WHERE SYSTEM_VALUE_NAME = 'QPRCFEAT') AS PROCESSOR_FEATURE,

  PARTITION_ID
   FROM QSYS2.SYSTEM_STATUS_INFO;


Respectfully,
Michael Mayer
IBM i on Power System Admin
INFOR LN Jr ERP Admin
ERMCO-ECI

ibmireference.blogspot.com<http://ibmireference.blogspot.com>
IBM 2024/2025/2026 Advocate, Contributor, Influencer + the 2024 IBM i Ready Badge + the 2026 IBM "Bob" AI Badge.
www.credly.com/users/michael-mayer.586da683/badges#credly<http://www.credly.com/users/michael-mayer.586da683/badges#credly>


________________________________
zer)
   3. Retrieving numeric partition ID in SQL (Dan Bale via MIDRANGE-L)


----------------------------------------------------------------------



message: 3
date: Thu, 30 Jul 2026 05:22:24 +0000
from: Dan Bale via MIDRANGE-L <[email protected]>
subject: Retrieving numeric partition ID in SQL

I need SQL to retrieve the serial number, model, processor feature code, and numeric partition ID.  The first three are system values, easy enough.  The numeric partition ID has escaped resolution so far.  Since I am developing a procedure that uses 3-part naming to run this SQL on all of our systems from one system, I am trying to avoid having to utilize anything that doesn't already exist on the remote systems.  (So, I want to avoid developing an application that needs to be deployed to all of the remote systems.)

In ACS RSS, I tried:
> CL: call qsys/QLZARCAPI;
and this returned two messages with the output in the RSS message pane as well as in the job log.  Are these messages invisible to SQL?

I also tried:
> select qsys2.qcmdexc('call qsys/QLZARCAPI') as callresult from SYSIBM.sysdummy1;
and this returned a result of '1' (success) and two messages with the output in the job log.


Ideas appreciated.

- Dan Bale
-- 
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.

You can help support midrange.com by visiting https://donate.midrange.com and making a contribution.