How to known the z/OS version in a batch program

5 pts.
Tags:
AS/400 jobs
Batch jobs
z/OS
Hi,

I want known the z/OS version in the program. For instance, how to does it  retrive the command "D IPLINFO", in a batch program?

Thanks,

Evandro



Software/Hardware used:
IBM z/OS

Answer Wiki

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

All you need do is access some of the MVS system areas.
Here is a small COBOL program to get you what you want and more. (you can tell I’ve had this for a while, the program refers to the operating system as os/390. )
There is A LOT more information available in the MVS system areas. Check out the IBM manuals for even more info. an OLD URL is shown in the program comments.

<pre>000600 CBL NOLIB,APOST,NODECK,OBJECT,NOSEQ,BUF(10000),NONAME
000700 CBL NOMAP,NOLIST,NOOFFSET,NOXREF
000800 IDENTIFICATION DIVISION.
000900 PROGRAM-ID. COB2SYS.
001200 * *
001300 * THIS PROGRAM RETRIEVES SPECIFIC SYSTEM-RELATED DATA FROM *
001400 * MVS CONTROL BLOCKS AND MOVES IT TO WORKING-STORAGE. *
001500 * *
001600 * THE NAME OF THE CONTROL-BLOCK IS INDICATED IN POS 1-6 OF *
001700 * THE PROCEDURE DIVISION LINES. *
001800 * THE LAYOUT OF THE MVS CONTROL BLOCKS IS DESCRIBED IN THE *
001900 * MVS DATA AREAS MANUALS, WHICH CAN BE FOUND ON ANY MVS OR *
002000 * OS/390 CD COLLECTION OR VIEWED ON-LINE BY GOING TO: *
002100 * HTTP://WWW.S390.IBM.COM/BOOKMGR-CGI/BOOKMGR.CMD/LIBRARY *
002200 * AND SEARCHING FOR: *
002300 * MVS DATA AREAS *
002400 * *
002610 DATA DIVISION.
002700 WORKING-STORAGE SECTION.
002800 01 RESULTS.
002900 05 SYS-NAME PIC X(8).
003000 05 REAL-STORAGE-M PIC S9(6) COMP.
003100 05 PRODI PIC X(8).
003200 05 PRODN PIC X(8).
003300 05 MDL PIC 9999.
003400 05 SMF-NAME PIC X(4).
003500 05 IPL-JDATE PIC 9(7) COMP-3.
003600 05 SU-SEC PIC S9(6) COMP.
003700 05 CPU-TYPE PIC X(6).
003800 05 CPU-MODEL PIC X(3).
003900 05 SYSPLEX-NAME PIC X(8).
004000 05 OS390-RELEASE PIC 9(6).
004100 05 HARDWARE-NAME PIC X(8).
004200 05 LPAR-NAME PIC X(8).
004300 05 VM-USERID PIC X(8).
004400 01 FOUR-BYTES.
004500 05 FULL-WORD PIC S9(8) COMP.
004600 05 PTR4 REDEFINES FULL-WORD POINTER.
004700 05 PL4 REDEFINES FULL-WORD PIC 9(7) COMP-3.
004800 LINKAGE SECTION.
004900 01 CB1. 05 PTR1 POINTER OCCURS 512.
005000 01 CVT. 05 CVT1 POINTER OCCURS 512.
005100 PROCEDURE DIVISION.
005200 PSA SET ADDRESS OF CB1 TO NULL
005300 CVT SET ADDRESS OF CVT TO PTR1(5)
005400 MOVE CVT(341:8) TO SYS-NAME
005500 MOVE CVT(857:4) TO FOUR-BYTES
005600 COMPUTE REAL-STORAGE-M = (FULL-WORD + 1023) / 1024
005700 DISPLAY ‘ SYSNAME=’ SYS-NAME
005800 DISPLAY ‘ STOR=’ REAL-STORAGE-M ‘M’
005900 CVTFIX SET PTR4 TO ADDRESS OF CVT
006000 SUBTRACT 256 FROM FULL-WORD
006100 SET ADDRESS OF CB1 TO PTR4
006200 MOVE CB1(217:8) TO PRODI
006300 MOVE CB1(225:8) TO PRODN
006400 MOVE ZERO TO PL4
006500 MOVE CB1(251:2) TO FOUR-BYTES(1:2)
006600 COMPUTE MDL = PL4 / 1000
006700 DISPLAY ‘ PRODI=’ PRODI
006800 DISPLAY ‘ PRODN=’ PRODN
006900 DISPLAY ‘ MODEL=’ MDL
007000 SMCA SET ADDRESS OF CB1 TO CVT1(50)
007200 MOVE CB1(17:4) TO SMF-NAME
007300 MOVE CB1(341:4) TO FOUR-BYTES
007400 COMPUTE IPL-JDATE = PL4 + 1900000
007500 DISPLAY ‘ SMFSID=’ SMF-NAME
007600 DISPLAY ‘ IPL=’ IPL-JDATE
007800 RMCT SET ADDRESS OF CB1 TO CVT1(152)
007900 MOVE CB1(65:4) TO FOUR-BYTES
008000 COMPUTE SU-SEC = 16000000 / FULL-WORD
008100 DISPLAY ‘ SPEED=’ SU-SEC ‘ SU/S’
008200 HID SET ADDRESS OF CB1 TO CVT1(268)
008300 MOVE CB1(27:6) TO CPU-TYPE
008400 MOVE CB1(33:3) TO CPU-MODEL
008500 DISPLAY ‘ CPU=’ CPU-TYPE ‘-’ CPU-MODEL
008600 ECVT SET ADDRESS OF CB1 TO CVT1(36)
008700 MOVE CB1(9:8) TO SYSPLEX-NAME
008800 MOVE CB1(337:8) TO HARDWARE-NAME
008900 MOVE CB1(345:8) TO LPAR-NAME
009000 MOVE CB1(353:8) TO VM-USERID
009100 MOVE CB1(513:6) TO OS390-RELEASE
009200 DISPLAY ‘ SYSPLEX=’ SYSPLEX-NAME
009300 DISPLAY ‘ HWNAME=’ HARDWARE-NAME
009400 DISPLAY ‘ LPAR=’ LPAR-NAME
009500 DISPLAY ‘ VM=’ VM-USERID
009600 DISPLAY ‘ OS/390=’ OS390-RELEASE
009700 GOBACK. </pre>

Discuss This Question: 1  Reply

 
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
  • TomLiotta
    Was this tagged with "AS/400 batch jobs" for a reason other than a mistake? The question doesn't seem to have anything to do AS/400s. Tom
    125,585 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