Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to determine the CPU serial number

401 views
Skip to first unread message

Dave Salt

unread,
Jul 9, 2008, 6:12:56 PM7/9/08
to
I use the SYSCPUS system variable to determine the CPU serial number. For example, if the following REXX procedure:

cpurc = syscpus("cpus_stem.")say cpus_stem.1
Returns this value:

012345672096

Then the CPU model number is 2096, and the serial number is the preceeding 4 characters; i.e. 4567. However, I have a customer that just ran this procedure and it returned something like this:

FF0000002096

As you can see, the CPU serial number is returned as '0000'. Has anyone ever come across this or know what causes it?

Thanks!

Dave SaltSee the new SimpList(tm) rollover image at: http://www.mackinney.com/products/SIM/simplist.htm
_________________________________________________________________
Find hidden words, unscramble celebrity names, or try the ultimate crossword puzzle with Live Search Games. Play now!
http://g.msn.ca/ca55/212
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Cruz, Robert

unread,
Jul 9, 2008, 6:16:19 PM7/9/08
to
This is the format returned by a virtual machine under VM/CMS.
You can issue a VM command to find out the actual value.
(Sorry, I've been away from VM so long that I'm uncertain, but I think
its something like QUERY CPUID)

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

The information contained in this message is intended only for the recipient, and may be a confidential attorney-client communication or may otherwise be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, please be aware that any dissemination or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify us by replying to the message and deleting it from your computer. The McGraw-Hill Companies, Inc. reserves the right, subject to applicable local law, to monitor and review the content of any electronic message or information sent to or from McGraw-Hill employee e-mail addresses without informing the sender or recipient of the message.
--------------------------------------------------------

Dave Salt

unread,
Jul 9, 2008, 6:26:58 PM7/9/08
to

Thanks Robert. I know absolutely nothing about VM, so can someone help by telling me exactly what I'd need to put in my REXX procedure to determine the 4 digit CPU serial number if my REXX is running on a virtual machine? Or even perhaps a way to simply detect if my REXX is running on a virtual machine? Thanks in advance, Dave SaltSee the new SimpList(tm) rollover image at: http://www.mackinney.com/products/SIM/simplist.htm > Date: Wed, 9 Jul 2008 15:18:27 -0700> From: Rober...@CTB.COM> Subject: Re: How

Raymond Noal

unread,
Jul 9, 2008, 7:35:11 PM7/9/08
to
Dave,

Try this -

/* rexx */

trace OFF

'EXECIO 1 CP (VAR IPSERNUM STRING Q CPUID';

if substr(IPSERNUM,9,2) = 'FF';then say 'Running in a virtual machine';

say 'We are running in LPAR - 'substr(IPSERNUM,11,2);

say 'The processor serial number is - 'substr(IPSERNUM,13,4);

exit;

Ready; T=0.01/0.01 16:32:23
cpuid
Running in a virtual machine
We are running in LPAR - 16
The processor serial number is - AC8E
Ready; T=0.01/0.01 16:32:29

HITACHI
 DATA SYSTEMS
Raymond E. Noal
Senior Technical Engineer
Office: (408) 970 - 7978

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Dave Salt

Dave Salt

unread,
Jul 9, 2008, 10:19:05 PM7/9/08
to
Hi Raymond,

Thank you VERY much for your REXX sample! I just ran it on my z/OS 1.9 machine and the EXECIO statement failed with this message:

IRX0603E EXECIO "operation" positional parameter is not valid. Specify DISKR, DISKRU, or DISKW.

I'm guessing it's because "EXECIO 1 CP" is something that will only run on VM? If that's the case, I'd need to make sure this statement in my REXX procedure only executes if I'm on a virtual machine. Otherwise, the above error message would be displayed and there doesn't seem to be any way I can stop it.

Looking at your REXX code, I see that if the IPSERNUM is 'FF', this means it's a virtual machine. Is this the same indicator that's returned by the first 2 characters in the SYSCPUS variable? For example, my customer said that when he runs this REXX code:

cpurc = syscpus("cpus_stem.")
say cpus_stem.1

He sees this result: FF0000002084

Note that the first 2 characters are 'FF'; does this indicate for sure that he's on a virtual machine? If so, would the following code identify the CPU serial number for both regular and virtual machines?

cpurc = syscpus("cpus_stem.")
if left(cpus_stem.1,2) = "FF" then do
"EXECIO 1 CP (VAR IPSERNUM STRING Q CPUID)"
say "The processor serial number is "substr(ipsernum,13,4)
end
else say "The processor serial number is "substr(cpus_stem.1,5,4)

Note that I've tested the above on my z/OS machine, and it correctly returns the serial number. But I don't have a virtual machine to test on, so there's no way for me to be sure this would work on a virtual machine. Could you or anyone else on this list please confirm that the above code would work on both a virtual and regular machine?

Thanks again for your help with this!

Dave Salt

See the new SimpList(tm) rollover image at:
http://www.mackinney.com/products/SIM/simplist.htm


> Date: Wed, 9 Jul 2008 16:34:06 -0700
> From: Raymon...@HDS.COM
> Subject: Re: How to determine the CPU serial number
> To: TSO-...@VM.MARIST.EDU

_________________________________________________________________

Lindy Mayfield

unread,
Jul 10, 2008, 6:45:33 AM7/10/08
to
As always we aren't satisfied in the Rexx list until we've explored all possibilities. (-:

Mark Zelden has a nice exec that shows all the CPU serial numbers plus a bunch more information. It is called IPLINFO.

http://home.flash.net/~mzelden/mvsutil.html

Lindy Mayfield

unread,
Jul 10, 2008, 8:43:55 AM7/10/08
to
Somewhere there might say what kind of CPU it is (zIIP, zAAP, etc). Like in the D M=CPU display, for example:

RESPONSE=ZMVS
IEE174I 15.41.51 DISPLAY M 914
PROCESSOR STATUS
ID CPU SERIAL
00 + 07B77A2094
01 + 07B77A2094
02 + 07B77A2094
03 + 07B77A2094
04 + 07B77A2094
05 + 07B77A2094
06 +I 07B77A2094
07 +A 07B77A2094
08 +A 07B77A2094

CPC ND = 002094.S18.IBM.02.00000004B77A
CPC SI = 2094.714.IBM.02.000000000004B77A
CPC ID = 00

+ ONLINE - OFFLINE . DOES NOT EXIST W WLM-MANAGED
N NOT AVAILABLE

A APPLICATION ASSIST PROCESSOR (zAAP)
I INTEGRATED INFORMATION PROCESSOR (zIIP)
CPC ND CENTRAL PROCESSING COMPLEX NODE DESCRIPTOR
CPC SI SYSTEM INFORMATION FROM STSI INSTRUCTION
CPC ID CENTRAL PROCESSING COMPLEX IDENTIFIER

I'm sure a peek at the control block that Mark uses in his IPLINFO would tell.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Dave Salt

Sent: 10. heinäkuuta 2008 5:19

Dave Salt

unread,
Jul 10, 2008, 10:50:48 AM7/10/08
to
> From: lindy.m...@SSF.SAS.COM

> Somewhere there might say what kind of CPU it is (zIIP, zAAP, etc).

The customer said that when they run this:

cpurc = syscpus("cpus_stem.")
say cpus_stem.1

They see this: FF0000002084

Note that it's all zeroes where the CPU serial number is supposed to be. I'm wondering if the 'FF' at the start indicates they're running under z/VM instead of z/OS? If so, at least I'll have a way to tell what type of system they're on, and then perhaps be able to take a different logic path to determine their CPU serial number. So, this brings up 2 questions:

1) Can anyone confirm if the leading 'FF' returned by the SYSCPUS system variable indicates z/VM?
2) If z/OS is being run under z/VM, does anyone know how to get the CPU serial number?

Thanks!

Dave Salt

See the new SimpList(tm) rollover image at:
http://www.mackinney.com/products/SIM/simplist.htm

_________________________________________________________________
Try Chicktionary, a game that tests how many words you can form from the letters given. Find this and more puzzles at Live Search Games!
http://g.msn.ca/ca55/207

Hardee, Charles H

unread,
Jul 10, 2008, 10:55:24 AM7/10/08
to
Hi Dave,

It's been many years since I was in a VM world with guest OSes, but when
I was, it was pointed out to me that the CPU id was, in fact, marked
with x'FF' as the high order byte to indicate that the OS was a guest
beneath VM.

Given your client's results, I suspect this has not changed. I would,
however, hope that someone with more current knowledge than I can
confirm or refute this.

Good Luck,
Chuck

<snip>


The customer said that when they run this:

cpurc = syscpus("cpus_stem.")
say cpus_stem.1

They see this: FF0000002084

</snip>

Lindy Mayfield

unread,
Jul 10, 2008, 11:34:15 AM7/10/08
to
Yes, on a real z/OS no FF's, and on z/OS running as a guest on z/VM there are the leading FF's.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Dave Salt
Sent: 10. heinäkuuta 2008 17:51
To: TSO-...@VM.MARIST.EDU
Subject: Re: [TSO-REXX] How to determine the CPU serial number

Cruz, Robert

unread,
Jul 10, 2008, 11:39:38 AM7/10/08
to
Yes, the leading FF indicates a guest OS under VM.
The example given earlier of QUERY CPUID will work *when SYSCPUS returns
FF*, but NOT otherwise.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf
Of Dave Salt
Sent: Thursday 10 July 2008 07:51
To: TSO-...@VM.MARIST.EDU
Subject: Re: [TSO-REXX] How to determine the CPU serial number

They see this: FF0000002084

Thanks!

Dave Salt

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

The information contained in this message is intended only for the recipient, and may be a confidential attorney-client communication or may otherwise be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, please be aware that any dissemination or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify us by replying to the message and deleting it from your computer. The McGraw-Hill Companies, Inc. reserves the right, subject to applicable local law, to monitor and review the content of any electronic message or information sent to or from McGraw-Hill employee e-mail addresses without informing the sender or recipient of the message.
--------------------------------------------------------

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

Cruz, Robert

unread,
Jul 10, 2008, 11:53:02 AM7/10/08
to
The QUERY CPUID should only be run after you have determined that the
high-order value returned by SYSCPUS is FF. Furthermore, since you are
running in a virtual machine, z/OS does not know of the existence of VM.
The z/OS EXECIO command does not support the CP operand, even in this
environment (unlike the CMS environment which is aware of CP). You will
need a different mechanism to communicate with VM/CP. I will try to
follow up with more info on that during my lunch break today.

Hi Raymond,

Dave Salt

_________________________________________________________________

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

The information contained in this message is intended only for the recipient, and may be a confidential attorney-client communication or may otherwise be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, please be aware that any dissemination or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify us by replying to the message and deleting it from your computer. The McGraw-Hill Companies, Inc. reserves the right, subject to applicable local law, to monitor and review the content of any electronic message or information sent to or from McGraw-Hill employee e-mail addresses without informing the sender or recipient of the message.
--------------------------------------------------------

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

Dave Salt

unread,
Jul 10, 2008, 12:12:17 PM7/10/08
to
Hi Robert,

Thanks for the clarification regarding the QUERY CPUID command. As I don't have access to z/VM, someone tried the command for me on their z/VM machine and it failed. Another poster suggested an assembler solution, and I might follow up on that if I can't do what I want in REXX, so thanks to Bill for suggesting it. But meanwhile I've come up with the following REXX and it seems to work in both a z/OS and z/VM environment:

/* REXX to display 4 digit CPU serial number */
CVT = C2d(Storage(10,4))
CVTHID = C2d(Storage(D2x(CVT + 1068),4))
CPUNUM = Storage(D2x(CVTHID+48),4)
say "CPU serial number = "cpunum

This has only been tested by 1 person, but the indication was that it correctly returned the CPU serial number. If anyone else has a machine where z/OS is running as a guest under z/VM, I'd really appreciate it if you could try the above and let me know if it works.

Thanks!

Dave Salt

See the new SimpList(tm) rollover image at:
http://www.mackinney.com/products/SIM/simplist.htm


> Date: Thu, 10 Jul 2008 08:54:58 -0700
> From: Rober...@CTB.COM

Cruz, Robert

unread,
Jul 10, 2008, 12:17:21 PM7/10/08
to
I had considered obtaining the CPUID by linking from page 0, but I
believed that the value stored there would be the one provided by VM.
Please re-run this test including a SYSCPUS output, to confirm that you
are running as a guest (SYSCPUS will return a CPUID starting with FF)
0 new messages