What LPAR I am in?

75 pts.
Tags:
LPAR
Is there a quick way to know wich LPAR I am working on? Or to know where I have my applications installed in? Any command to do this? Sometimes when trying to upgrade products I need to know where a product application software is installed, since passwords for this products depend on LPAR where installed. Thanks

Software/Hardware used:
AS/400

Answer Wiki

Thanks. We'll let you know when a new response is added.

I don’t know of any command off hand, but here’s a quick and dirty ILE CL program that displays the current partition ID.

Pgm

Dcl Var(&Part_Info) Type(*Char) Len(10)
Dcl Var(&BytPrv) Type(*Int) Stg(*Defined) +
DefVar(&Part_Info 1)
Dcl Var(&BytAvl) Type(*Int) Stg(*Defined) +
DefVar(&Part_Info 5)
Dcl Var(&Cur_Part) Type(*Char) Stg(*Defined) +
Len(1) DefVar(&Part_Info 10)

Dcl Var(&Nbr_Part) Type(*Int) Len(2)
Dcl Var(&Chr_Part) Type(*Char) Stg(*Defined) +
Len(1) DefVar(&Nbr_Part 2)

Dcl Var(&Partition) Type(*Char) Len(5)

ChgVar Var(&BytPrv) Value(10)
CallPrc Prc('_MATMATR1') Parm((&Part_Info) (x'01E0'))
ChgVar Var(&Chr_Part) Value(&Cur_Part)
ChgVar Var(&Partition) Value(&Nbr_Part)
SndPgmMsg Msg(&Partition)

EndPgm

You can do the same using any ILE language.

Bruce Vining

=============================================

Though I tend to use _MATMATR1 also, an additional possibility is the Retrieve System Status (QWCRSSTS) API requesting format SSTS0200. Partition identifier is at offset 80 (4-byte integer, 10i 0 in RPG).

Also, on the GO SERVICE menu, option 6, Display service registration information, partition number is displayed in the headings. Useful for interactive research.

Tom

=============================================

Sure there is. But first, I am curious why a question like this wouldn’t be asked of others in your work place. Like your SYSPROG.

A TSO variable called “&SYSNAME” holds the LPAR (or system) name. The variable can be used in CLIST or REXX. Example:

IF &STR(&SYSNAME) ¬= &STR(SYSB) THEN +

in that example “SYSB” is the name I am comparing the variable to.

Here is a COBOL example to display various pieces of info on the screen. And a reference to the web page containing the IBM manual with this info.

* THE NAME OF THE CONTROL-BLOCK IS INDICATED IN POS 1-6 OF
* THE PROCEDURE DIVISION LINES.
* THE LAYOUT OF THE MVS CONTROL BLOCKS IS DESCRIBED IN THE
* MVS DATA AREAS MANUALS, WHICH CAN BE FOUND ON ANY MVS OR
* OS/390 CD COLLECTION OR VIEWED ON-LINE BY GOING TO:
* HTTP://WWW.S390.IBM.COM/BOOKMGR-CGI/BOOKMGR.CMD/LIBRARY
* AND SEARCHING FOR:
* MVS DATA AREAS

WORKING-STORAGE SECTION.
01 RESULTS.
05 SYS-NAME PIC X(8).
05 REAL-STORAGE-M PIC S9(6) COMP.
05 PRODI PIC X(8).
05 PRODN PIC X(8).
05 MDL PIC 9999.
05 SMF-NAME PIC X(4).
05 IPL-JDATE PIC 9(7) COMP-3.
05 SU-SEC PIC S9(6) COMP.
05 CPU-TYPE PIC X(6).
05 CPU-MODEL PIC X(3).
05 SYSPLEX-NAME PIC X(8).
05 OS390-RELEASE PIC 9(6).
05 HARDWARE-NAME PIC X(8).
05 LPAR-NAME PIC X(8).
05 VM-USERID PIC X(8).
01 FOUR-BYTES.
05 FULL-WORD PIC S9(8) COMP.
05 PTR4 REDEFINES FULL-WORD POINTER.
05 PL4 REDEFINES FULL-WORD PIC 9(7) COMP-3.
LINKAGE SECTION.
01 CB1. 05 PTR1 POINTER OCCURS 512.
01 CVT. 05 CVT1 POINTER OCCURS 512.
PROCEDURE DIVISION.
PSA SET ADDRESS OF CB1 TO NULL
CVT SET ADDRESS OF CVT TO PTR1(5)
MOVE CVT(341:8) TO SYS-NAME
MOVE CVT(857:4) TO FOUR-BYTES
COMPUTE REAL-STORAGE-M = (FULL-WORD + 1023) / 1024
DISPLAY ' SYSNAME=' SYS-NAME
DISPLAY ' STOR=' REAL-STORAGE-M 'M'
CVTFIX SET PTR4 TO ADDRESS OF CVT
SUBTRACT 256 FROM FULL-WORD
SET ADDRESS OF CB1 TO PTR4
MOVE CB1(217:8) TO PRODI
MOVE CB1(225:8) TO PRODN
MOVE ZERO TO PL4
MOVE CB1(251:2) TO FOUR-BYTES(1:2)
COMPUTE MDL = PL4 / 1000
DISPLAY ' PRODI=' PRODI
DISPLAY ' PRODN=' PRODN
DISPLAY ' MODEL=' MDL
SMCA SET ADDRESS OF CB1 TO CVT1(50)
MOVE CB1(17:4) TO SMF-NAME
MOVE CB1(341:4) TO FOUR-BYTES
COMPUTE IPL-JDATE = PL4 + 1900000
DISPLAY ' SMFSID=' SMF-NAME
DISPLAY ' IPL=' IPL-JDATE
RMCT SET ADDRESS OF CB1 TO CVT1(152)
MOVE CB1(65:4) TO FOUR-BYTES
COMPUTE SU-SEC = 16000000 / FULL-WORD
DISPLAY ' SPEED=' SU-SEC ' SU/S'
HID SET ADDRESS OF CB1 TO CVT1(268)
MOVE CB1(27:6) TO CPU-TYPE
MOVE CB1(33:3) TO CPU-MODEL
DISPLAY ' CPU=' CPU-TYPE '-' CPU-MODEL
ECVT SET ADDRESS OF CB1 TO CVT1(36)
MOVE CB1(9:8) TO SYSPLEX-NAME
MOVE CB1(337:8) TO HARDWARE-NAME
MOVE CB1(345:8) TO LPAR-NAME
MOVE CB1(353:8) TO VM-USERID
MOVE CB1(513:6) TO OS390-RELEASE
DISPLAY ' SYSPLEX=' SYSPLEX-NAME
DISPLAY ' HWNAME=' HARDWARE-NAME
DISPLAY ' LPAR=' LPAR-NAME
DISPLAY ' VM=' VM-USERID
DISPLAY ' OS/390=' OS390-RELEASE
GOBACK.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Meandyou
    OOPS !!! The answer I supplied is for z/OS. I did not see your reference to "AS/400" until later. I just saw the word LPAR and assumed you meant big iron so I gave you an answer. Sorry.
    5,220 pointsBadges:
    report
  • A4ginatl
    your question is rather broad. Do you just want to know which system you are signed onto? or do you need to know the partition id. There are 2 solutions for the partition ID and if its just to know whch partition your are signed in to, your system name should tell you. You could have all partitions have the same system name. You should change them to be different and you would do that with the CHGNETA commend.
    95 pointsBadges:
    report
  • graybeard52
    RTVNETA SYSNAME(&SYSNAME) Then test &SYSNAME.
    3,115 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following