Skip to Main Content
IBM Z Software


This portal is to open public enhancement requests against IBM Z Software products. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Not under consideration
Workspace COBOL Compilers
Created by Guest
Created on Jul 3, 2017

Having some system data available via standard COBOL word/ function.

Hi,
in my shop several developers are using some basic system data like LPAR name, SMFID, job name step name...
Despite many enhancements COBOL don't offer today some way to have this data at hand.
So the developers create many module to have access to this data

Idea priority Medium
  • Guest
    Reply
    |
    Sep 27, 2017

    This can be achieved by a program similar to the following:

    $ cat system.cbl
    CBL NOLIB,APOST,NODECK,OBJECT,NOSEQ,BUF(10000),NONAME
    CBL NOMAP,NOLIST,NOOFFSET,NOXREF
    Identification Division.
    Program-ID. Cob2Sys.
    *----------------------------------------------------------------*
    * *
    * This program retrieves specific system-related data from *
    * MVS control blocks and moves it to Working-storage. *
    * *
    * 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 *
    * *
    *----------------------------------------------------------------*

    Data Division.
    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
    * System Management Control Area
    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
    * System Resources Manager Control Table
    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'
    * Host ID
    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
    * Extended CVT
    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.
    $

  • Guest
    Reply
    |
    Aug 2, 2017

    Require more time to investigate.

  • Guest
    Reply
    |
    Jul 12, 2017

    It's not apparent to me that this should be supplied as an enhancement to COBOL. Rather, perhaps LE could supply callable routines that could be used to get this information.