Suggestions for learning about control blocks
Posted: Sat Feb 12, 2022 12:22 pm
Does anyone here have any manuals or other resources they could share that would help learn how to get information from control blocks? I'm new to this so I'm not even sure I'm asking the correct question.
I've watched this: https://www.youtube.com/watch?v=L-scxwawCXA
and read this: http://zseries.marist.edu/pdfs/ztidbitz ... cks%29.pdf
And read some of the IBM manuals and was able to figure out the very basics but I still feel lost on how to actually do the conversions and everything to get the info I need. If I use the code from the video above I can do a little bit but I definitely can't do it on my own. Here's the rexx code from the video and some little additions I made, maybe it'll give a clearer picture of what I'm asking.
/* REXX */ 00010000
/* INVOKED FROM TSO COMMAND LINE FROM REXX INTERPRETER OR */
/* AFTER COMPILATION WITH THE REXX COMPILER AS A LOAD MODULE */
CVT = DREF(16) /* GO TO CVT TABLE */
ASCB = DREF(548) /* GO TO ASCB */
ASXB = DREF(ASCB+108) /* GO TO ASXB */
ACEE = DREF(ASXB+200) /* ACEE ADRS */
TERM = CINFO(ACEE+64,8) /* TERMINAL ID */
UID = CINFO(ACEE+21,8) /* USERID THRU RACF*/
GRP = CINFO(ACEE+29,9) /* GROUP NAME INFO */
OPUT = 'USER='SYSVAR('SYSUID'), /* WHOAMI */
'TERM='TERM, /* WHEREAMI */
'UID='UID, /* USER ID */
'GRP='GRP /* GROUP NAME */
SAY OPUT
EXIT
CINFO: RETURN STRIP(STORAGE(D2X(ARG(1)),ARG(2)))
DREF: RETURN C2D(BITAND(STORAGE(D2X(ARG(1)),4),'7FFFFFF'X))
It's mostly the part at the bottom of the code, the CINFO and DREF parts that I'm not quite sure how to figure out.
Does anyone have any resources for learning more about it? Would learning assembler help me understand better? Also, I hope this is the right part of the forum to ask this
I've watched this: https://www.youtube.com/watch?v=L-scxwawCXA
and read this: http://zseries.marist.edu/pdfs/ztidbitz ... cks%29.pdf
And read some of the IBM manuals and was able to figure out the very basics but I still feel lost on how to actually do the conversions and everything to get the info I need. If I use the code from the video above I can do a little bit but I definitely can't do it on my own. Here's the rexx code from the video and some little additions I made, maybe it'll give a clearer picture of what I'm asking.
/* REXX */ 00010000
/* INVOKED FROM TSO COMMAND LINE FROM REXX INTERPRETER OR */
/* AFTER COMPILATION WITH THE REXX COMPILER AS A LOAD MODULE */
CVT = DREF(16) /* GO TO CVT TABLE */
ASCB = DREF(548) /* GO TO ASCB */
ASXB = DREF(ASCB+108) /* GO TO ASXB */
ACEE = DREF(ASXB+200) /* ACEE ADRS */
TERM = CINFO(ACEE+64,8) /* TERMINAL ID */
UID = CINFO(ACEE+21,8) /* USERID THRU RACF*/
GRP = CINFO(ACEE+29,9) /* GROUP NAME INFO */
OPUT = 'USER='SYSVAR('SYSUID'), /* WHOAMI */
'TERM='TERM, /* WHEREAMI */
'UID='UID, /* USER ID */
'GRP='GRP /* GROUP NAME */
SAY OPUT
EXIT
CINFO: RETURN STRIP(STORAGE(D2X(ARG(1)),ARG(2)))
DREF: RETURN C2D(BITAND(STORAGE(D2X(ARG(1)),4),'7FFFFFF'X))
It's mostly the part at the bottom of the code, the CINFO and DREF parts that I'm not quite sure how to figure out.
Does anyone have any resources for learning more about it? Would learning assembler help me understand better? Also, I hope this is the right part of the forum to ask this