Skip to content

Instantly share code, notes, and snippets.

@bdietz400
Created May 15, 2023 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdietz400/11c4244f45714408ff627d831ab747e1 to your computer and use it in GitHub Desktop.
Save bdietz400/11c4244f45714408ff627d831ab747e1 to your computer and use it in GitHub Desktop.
* example of getting HMC name and IP address
* https://www.ibm.com/docs/en/i/7.4?topic=instructions-materialize-machine-attributes-matmatr#MATMATR__mat0204
h DFTACTGRP(*no)
d matmatr_tmpl ds
d bytes_in 10i 0
d bytes_avail 10i 0
d NoOfEntries 10I 0
d reserved 4a
d hmcinfolen 5i 0
d HMCInfo 1034a
D QUILNGTX PR ExtPgm('QUILNGTX')
D text 65535a const options(*varsize)
D length 10i 0 const
D msgid 7a const
D qualmsgf 20a const
D errorCode 32783a options(*varsize)
D ErrorNull ds qualified
D BytesProv 10i 0 inz(0)
D BytesAvail 10i 0 inz(0)
D Translate PR ExtPgm('QDCXLATE')
D Length 5P 0 const
D Data 32766A options(*varsize)
D Table 10A const
d matmatr_opt s 2a inz(x'0204')
c eval bytes_in = %size(matmatr_tmpl)
c callb '_MATMATR1'
c parm matmatr_tmpl
c parm matmatr_opt
C callp Translate(hmcinfolen:
C* callp Translate(%len(hmcinfo):
C hmcinfo:
C 'QTCPEBC')
/free
QUILNGTX( hmcinfo
: hmcinfolen
: ' '
: ' '
: ErrorNull );
*inlr = *on;
/end-free
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment