Hello again,
I've been reading how to get for example the Jobname.
For I've read, I've to go to PSA, then, obtain the TCB address, get the TIOT address and then the Jobname.
In the "MVS Data Areas books", I've got the following :
PSA (get the TCB address) --> Offset Dec (540) Hex (21C)
TCB (get the TIOT address) --> Offset Dec (12) Hex (C)
In TCB I find that the OFFSET is 12, but I found a program that don't have that, but the information returned is correct. The code is like this (the addresses don't match). Get someone tell me why ?
PSA SET ADDRESS OF L-AREA1 TO NULL
*-----------------------------------------------------------
TCB SET ADDRESS OF L-AREA1 TO L-AREA1-PTR(136)
*-----------------------------------------------------------
TIOT SET ADDRESS OF L-AREA2 TO L-AREA1-PTR(4)
MOVE L-AREA2(1:8) TO MX298-JOB-NAME
Atenciosamente,
João Carvalho
* - mailto:***@caixaseguros.pt
"Em momentos de crise, só a imaginação é mais importante que o conhecimento"
(Albert Einstein)
P Antes de imprimir este e-mail pense bem se tem mesmo que o fazer. Há cada vez menos árvores
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Bob Stark
Sent: sábado, 30 de Junho de 2007 5:14
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] MVS Data Areas
João,
At the following site there are the MVS Data Areas books, volumes 1-5:
http://www-03.ibm.com/servers/eserver/zseries/zos/bkserv/r7pdf/mvs.html
It's pretty complex. When I started there were 3 tiny books that contained
almost everything an assembler programmer needed. Now there are more data
areas and less Assembler source code to browse. And fewer gurus to ask, but
now of course we have the Internet.
Assembler programmers can call system services to get back data (such as
GQSCAN to get ENQ data), or to do things Like raise an ENQ or Attach a
subtask.
As a REXX programmer, all that you can do is look through the data areas.
But there is a lot of data laying around.
There are two key control blocks in memory that help you find all the other
control blocks:
1. The PSA - Stands for Prefixed Save Area - it is the first couple thousand
or so bytes of memory, contains useful fields like PSATOLD which is the
pointer to the current TCB (task Control Block), and PSAAOLD, which is the
pointer to the current ASCB (address space control block). As MVS switches
tasks, it stores things into PSA, so that when your task is running, your
data is in the PSA.
2. The CVT - Stands for Communication Vector Table - it's pointer is located
at x'10' (decimal 16) into the PSA. It is a collection of pointers to other
control blocks. From it you can find lots of other things.
You'll see that fancy data gathering REXX code by awesome coders such as
Doug Nadel, Mark Zelden, Lionel Dyck, and others will often start by
fetching the CVT.
To learn more, I would recommend you pick apart some REXX code that
interests you by trying to find the first control block in the data areas
book, then the next, etc.
You can use IPCS under ISPF to do look at active memory; Then you can poke
around and browse these control blocks interactively.
Where possible, I would use a high level interface like the MVSVAR() and/or
SYSVAR() functions, if they can get the data, before I would fool around
with the STORAGE() function. That said, I have used the Storage() function a
good bit.
Regards,
Bob Stark
ProTech - When you're serious about Systems Management
Consulting, Software, and Training for z/OS, UNIX and Internet
www.protechtraining.com 800-373-9188 x150 412-445-8072
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
João Luís Matos Carvalho (DSI)
Sent: Thursday, June 28, 2007 1:32 PM
To: TSO-***@VM.MARIST.EDU
Subject: MVS Data Areas
Hello list !
Sorry this dummy question (and I don't know if this is the correct list to
do so) but, I've have done a few weeks ago a program that obtain certain
system info (JOBNAME;STEP NAME;IPL JDATE; etc....).
But to be honest, I didn't understand how that values were obtained, so I
copied the code....
But I want to understand how that info is obtained.
Can someone recommend me what books or sites to read/look ?
Atenciosamente,
João Carvalho
* - mailto:***@caixaseguros.pt
"Em momentos de crise, só a imaginação é mais importante que o conhecimento"
(Albert Einstein)
P Antes de imprimir este e-mail pense bem se tem mesmo que o fazer. Há cada
vez menos árvores
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email
to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
--
If this email is spam, report it here:
http://www.OnlyMyEmail.com/reportSpam?Id=Mzg3MzE6MzQyMjU2MzEzOmJzdGFya0Bwcm9
0ZWNocHRzLmNvbQ%3D%3D
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX