Get zOS Basic Info Using REXX Sample Program
Get zOS Basic Info Using REXX Sample Program
This sample program shows how to display basic mainframe processor and z/OS system information from a
REXX.
This REXX can be called by any TSO/E user. Just copy this REXX into a dataset, and issue the TSO/E
command
EXEC 'dataset.with.rexx'
/* Rexx */
Address TSO
Numeric Digits 64
/*====================================================================*/
/* */
/* Name: LPINFOX */
/* Description: Print out basic information about this z/OS image. */
/* */
/* This program is free software: you can redistribute it and/or */
/* modify it under the terms of the GNU General Public License as */
/* published by the Free Software Foundation, either version 3 of the */
/* License, or (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
/* General Public License for more details at */
/* http://www.gnu.org/licenses/ */
/* */
/* (c) Copyright 2011-2020 Longpela Expertise */
/* www.longpelaexpertise.com.au */
/*====================================================================*/
/* ------------------------------------------------------------------ */
/* */
/* Get z/OS name and version */
/* */
/* ------------------------------------------------------------------ */
cvtaddr = get_dec_addr(16) /* Get address of CVT */
zos_name = Strip(Storage(D2x(cvtaddr+340),8))
ecvtaddr = get_dec_addr(cvtaddr+140)
zos_ver = Strip(Storage(D2x(ecvtaddr+512),2))
zos_rel = Strip(Storage(D2x(ecvtaddr+514),2))
/* ------------------------------------------------------------------ */
/* */
/* Output Title */
/* */
/* ------------------------------------------------------------------ */
say '------------------------------------------------------'
say ' LPInfo: Information for z/OS' zos_name 'as of' Date()
say '------------------------------------------------------'
Say 'z/OS version:' zos_ver || '.' || zos_rel
/* ------------------------------------------------------------------ */
/* */
/* Output Sysplex and JES Information */
/* */
/* ------------------------------------------------------------------ */
sysplex_name = Strip(Storage(D2x(ecvtaddr+8),8))
Say 'Sysplex name:' sysplex_name
Say 'JES:' SYSVAR('SYSJES') '(Node' SYSVAR('SYSNODE') || ')'
/* ------------------------------------------------------------------ */
/* */
/* Output Security System Information */
/* */
/* ------------------------------------------------------------------ */
cvtrac = get_dec_addr(cvtaddr+992)
rcvtid = Storage(d2x(cvtrac),4)
If rcvtid = 'RCVT' Then say 'Security Software: RACF'
If rcvtid = 'RTSS' Then say 'Security Software: CA Top Secret'
If rcvtid = 'ACF2' Then say 'Security Software: CA ACF2'
Say ''
/* ------------------------------------------------------------------ */
/* */
/* Call IWMQVS to get MSU, LPAR and z/VM Info */
/* */
/* ------------------------------------------------------------------ */
Exit
/* ------------------------------------------------------------------ */
/* */
/* get_dec_addr */
/* */
/* Function to return address stored at address passed */
/* */
/* Input: addr = address of storage holding address needed */
/* Output: four bytes at addr (in decimal) */
/* ------------------------------------------------------------------ */
get_dec_addr:
Parse Arg addr
hex_addr = d2x(addr)
stor = Storage(hex_addr,4)
hex_stor = c2x(stor)
value = x2d(hex_stor)
Return value