View previous topic :: View next topic |
Author |
Message |
Edward Tu Beginner
Joined: 15 Mar 2008 Posts: 4 Topics: 1 Location: New York
|
Posted: Tue Mar 18, 2008 9:19 am Post subject: System control blocks |
|
|
Newbie here, glad I came across this site.
Just wanted to know if anyone is familiar with MVS system control blocks such as CVT, SIOT, DSAB, etc. |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Tue Mar 18, 2008 11:08 am Post subject: |
|
|
Please tell us what you are trying to accomplish?
The control blocks are described in the MVS Data Areas manuals. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
 |
Edward Tu Beginner
Joined: 15 Mar 2008 Posts: 4 Topics: 1 Location: New York
|
Posted: Tue Mar 18, 2008 12:32 pm Post subject: |
|
|
Wrote a BAL program years ago to query all the opened DCBs in an address space.
I can't recall exactly how the open DCBs addressability was established, only remember getting to their SIOT and JFCB by way of CVT and the current TCB. It will be great if someone can point the way.
Thanks. _________________ Ed Tu |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Tue Mar 18, 2008 5:06 pm Post subject: |
|
|
Something like this:
find TIOT (use EXTRACT macro or 10.???+C?)
Loop through tiot entries. For each TIOT entry, run the DSAB chain (GETDSAB macro to get the 1st one). When dsabtiot points to the current tiot entry, check dsabopct for the open count (>0). You can use the SIOT (available from the dsab entry via swareq) to get more information about the allocation and you can get additional info from the JFCB (use swareq to get that from the token in the tiot).
This is from some code also probably 20 years old, but I think that is what is doing. There may be a better way. From the GETDSAB description, it looks like you can just pass in the ddname from the TIOT (tioeddnm) and have it fetch the corresponding dsab address directly. _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html. |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Tue Mar 18, 2008 5:44 pm Post subject: |
|
|
found this in my archives (& slightly modified to do what you wanted): Code: | /* Rexx - print allocations and show open ddnames */
Numeric Digits 10 /* Allow up to 7fffffff */
tiotptr = 24 + ptr(12 + ptr(ptr(ptr(16)))) /* Get tiot address */
tioelngh = c2d(stg(tiotptr,1)) /* Length of 1st entry */
lastddname = "*"
Do Until tioelngh = 0 /* Scan until dd found */
tioeddnm = strip(stg(tiotptr + 4,8)) /* Get ddname from tiot */
If substr(tioeddnm,1,1) <> "00"x Then
Do
Parse Value "" With ddname op
If substr(tioeddnm,1,1) <> " " Then
ddname = tioeddnm
tioelngh = c2d(stg(tiotptr,1)) /* Length of next entry */
tioejfcb = stg(tiotptr + 12,3)
jfcb = swareq(tioejfcb) /* Convert sva to 31-bit addr */
dsname = strip(stg(jfcb,44)) /* Dsname jfcbdsnm */
If ddname <> "" & lastddname <> ddname Then
Do
p = find_dsab_chain()
Do While p <> 0 & op = ""
If c2d(stg(p + 16,4)) = tiotptr Then/* Found dsab of ddname */
op = "Open" /* Get open count */
p = ptr(4 + p)
End
End
lastddname = tioeddnm
Say left(op,8) left(ddname,8) dsname
End
tiotptr = tiotptr + tioelngh /* Get next entry */
tioelngh = c2d(stg(tiotptr,1)) /* Get entry length */
End
Return
/*-------------------------------------------------------------------*/
ptr:
Return c2d(storage(d2x(Arg(1)),4)) /* Return a pointer */
/*-------------------------------------------------------------------*/
stg:
Return storage(d2x(Arg(1)),Arg(2)) /* Return storage */
/*-------------------------------------------------------------------*/
swareq: /* From gilbert saint-flour */
Procedure
If right(c2x(Arg(1)),1) <> "F" Then /* Swa=Below ? */
Return c2d(Arg(1)) + 16 /* Yes, Return sva+16 */
sva = c2d(Arg(1)) /* Convert to decimal */
tcb = ptr(540) /* Tcb psatold */
jscb = ptr(tcb + 180) /* Jscb tcbjscb */
qmpl = ptr(jscb + 244) /* Qmpl jscbqmpi */
qmat = ptr(qmpl + 24) /* Qmat qmadd */
Do While sva > 65536
qmat = ptr(qmat + 12) /* Next qmat qmat+12 */
sva = sva - 65536 /* 010006f -> 000006f */
End
Return ptr(qmat + sva + 1) + 16
/*-------------------------------------------------------------------*/
find_dsab_chain: /* 10.???+B4?+140?+C? */
Return ptr(12 + ptr(320 + ptr(180 + ptr(ptr(ptr(16))))))
|
_________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html. |
|
Back to top |
|
 |
Edward Tu Beginner
Joined: 15 Mar 2008 Posts: 4 Topics: 1 Location: New York
|
Posted: Wed Mar 19, 2008 3:23 pm Post subject: |
|
|
Thank you semigeezer.
Is there a pointer in any of the control blocks mentioned that points to DCB directly? _________________ Ed Tu |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Thu Mar 20, 2008 5:28 pm Post subject: |
|
|
Hi Ed,
I've never had a need to do that so I'm afraid I don't know offhand. It seems to me that there is a pointer back somewhere but a search of the manuals didn't turn up anything for me. Maybe someone else here knows that one.
I used to use ISRDDN's storage browser to find interesting things in control blocks, but I didn't see anything that stood out using that either. _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html. |
|
Back to top |
|
 |
Edward Tu Beginner
Joined: 15 Mar 2008 Posts: 4 Topics: 1 Location: New York
|
Posted: Thu Mar 20, 2008 11:52 pm Post subject: |
|
|
Hello Semigeezer,
I went over the data area manual a couple more times, but still can't locate the DCBs for an address space from within. Thanks again though.
Sure am glad I found this site. _________________ Ed Tu |
|
Back to top |
|
 |
|
|