Re: REXX : how to determine the member name of a DD card



Hi!

You can go from TCB to TIOT and then from TIOT to JFCB.
In TIOT there is a "table" of all DD statements of the job, In each table
entry there is pointer to approp. JFCB. In JFCB there are entries( one on
more) for all DSN-s on this DD statement (>1 where concatenation occurs),
possibly. with member name (when dsn has form dsnname(membername)).



/*===REXX=====================2010/09/02===KF=======*/
/*---------------------------------------------------------------*/
/* Build stem zbiory_joba remembering names all DD statem. of */
/* job and for each dd statement DDNAME and name(s)(DSN) data */
/* sets (possibly with membername). */
/* Names - where on DD there are concatenated data sets. */
/*---------------------------------------------------------------*/
buld_jobs_files:
/*---------------------------------------------------------------*/
/* zbiory_joba.nr_dd.ddn-----> names of following jobs joba.(8b) */
/* zbiory_joba.nr_dd.ile------> number of concatenated data sets */
/* on this DD statement. */
/* zbiory_joba.nr_dd.nr_dsn.dsn------> dsn-s on DD number */
/* nr_dd. */
/* zbiory_joba.nr_dd.nr_dsn.mem------> member (or 8 spaces) for */
/* DSN number nr_dd. */
/* (DSN=dsnname(membername) */
/* */
/*---------------------------------------------------------------*/
/* TCB - task control block */
/* TIOT - task input/output table */
/* JFCB - Job File Control Block */
/*---------------------------------------------------------------*/
/* TCB+12 ------->TIOT */
/* TIOT+24 first DD entry */
/* +4(8 bytes=DDNAME) */
/* +12(3 bytes -swa coded JFCB address) */
/* | */
/* | */
/* V */
/* JFCB (44 bytes=DSN) */
/* JFCB+44 (8bytes=membername or spaces) */
/*===============================================================*/
/* start of current TCB - address 540 */
tcbadr=C2D(STORAGE(D2X(540),4))
/* from TCB to TIOT */

adrtioa=C2D(STORAGE(D2X(tcbadr+12),4))
/*------------------------------------------------*/
/* In TIOA "table" of all DD entries */
/* current jobstep. */
/*------------------------------------------------*/
/* skip first 24 bytes (not interesting for us) */
adrtioa=adrtioa+24 /* address of first DD segment */
dd_count=0
dsn_count=0
do forever /* do until entry length > 0 */
entrylen=C2D(STORAGE(D2X(adrtioa),1)) /* len of current entry */
/* on 1 byte! */
if entrylen=0 then
leave
adrdd=adrtioa+4
ddname=STORAGE(D2X(adrdd),8)
if ddname <> " " then do /* not concatenated or first in conc. */
dd_count=dd_count+1
zbiory_joba.dd_count.ddn=ddname
dsn_count=1
zbiory_joba.dd_count.ile=1
end
else do /* DD = spaces -> concatenation */
dsn_count=dsn_count+1 /* count conc. data sets */
zbiory_joba.dd_count.ile=dsn_count
end
/* from TIOT entry to JFCB */
/* JFCB address on 3 bytes! (and sva coded!) */
adrjfcb=C2D(STORAGE(D2X(adrtioa+12),3))
/* add left zreoes 8 digits ("4 bytes")*/
if LENGTH(adrjfcb)=2 then
adrjfcb='000000'||adrjfcb
if LENGTH(adrjfcb)=3 then
adrjfcb='00000'||adrjfcb
else
if LENGTH(adrjfcb)=4 then
adrjfcb='0000'||adrjfcb
else
if LENGTH(adrjfcb)=5 then
adrjfcb='000'||adrjfcb
else
if LENGTH(adrjfcb)=6 then
adrjfcb='00'||adrjfcb
else
if LENGTH(adrjfcb)=7 then
adrjfcb='0'||adrjfcb
/* uncode JFCB address */
if adrjfcb//16 <> 15 then
adrjfb=adrjfcb+16
else do
NUMERIC DIGITS 10 /* bo max. to 7FFFFFFF */
tcb=C2D(STORAGE(D2X(540),4))
jscb=C2D(STORAGE(D2X(tcb+180),4))
qmpl=C2D(STORAGE(D2X(jscb+244),4))
qmat=C2D(STORAGE(D2X(qmpl+24),4))
do forever
if adrjfcb>65536 then do
qmat=C2D(STORAGE(D2X(qmat+12),4))
adrjfcb=adrjfcb-65536;
end
else do
adrjfcb=C2D(STORAGE(D2X(qmat+adrjfcb+1),4))+16
leave
end
end
end
/* now adrjfcb is really JFCB address */
/* DSN-> (jfcb+0)and member (or 8 spaces)->(jfcb+44) */
dsnname=STRIP(STORAGE(D2X(adrjfcb),44))
member=STRIP(STORAGE(D2X(adrjfcb+44),8))
zbiory_joba.dd_count.dsn_count.dsn=dsnname
/* nazwa membra (o ile podano dsn=filename(membername)),lub 8 spacji*/
zbiory_joba.dd_count.dsn_count.mem=member
/* next dd entry in TIOT */
adrtioa=adrtioa+entrylen /* next dd entry */
end /* forever len>0 ( TIOT ) */
/* return */
novalue:
say 'Niezainicjowana zmienna w linii 'SIGL
exit 22
failure:
say 'Blad komendy w linii 'SIGL
exit 33
/***** Koniec zrodla *****/


regards

Karol Filipowicz
Poland

2010/9/8 CUNY Yann <YCUNY@xxxxxxxxxxxxxxxxxxx>

Hi all !



I have this JCL :



//STEP11 EXEC PGM=IKJEFT01,REGION=0M

//SYSTSIN DD *

PROFILE NOPREF

TEST15

/*

//SYSTSPRT DD SYSOUT=*

//SYSEXEC DD DSN=P3CUN.YANN.REXX,DISP=SHR

//IN DD DSN=P3CUN.YANN.JCL(TEST14),DISP=SHR





I need, in my rexx, to retrieve the member name of the DD CARD IN. With
the LISTDSI, I just have the pds name.

I don't want to add a paramèter. And I don't want to make an execio on
another dd card.



Any idea ?


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

.



Relevant Pages

  • =?iso-8859-1?Q?Re:_directory_blocks-determine_how_many?=
    ... the JFCB is just the internal representation of your DD ... If you do an 'I' from ISPF, ISPF does a RDJFCB, but the JFCB image returned ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Re: z/OS Control block question
    ... but "every TCB with the same TCBJSTCB will normally ... have the same TIOT" is true, when the two statements make the same point? ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Re: z/OS Control block question
    ... TIOT" is incorrect, but "every TCB with the same TCBJSTCB will normally ... For example, the Region Control Task is a jobstep task, and "under" ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Determining if DUMMY allocation
    ... indicator in the JFCB, but now I don't see it. ... require below the line storage (such as searching the TIOT and using SWAREQ ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • How to get filename of a DD PATH="xxxx" at runtime?
    ... I'm looking for a way to get the pathname/filename of a DD (specifying a PATH not a DD) at runtime.... ... I tried to get it out of the TIOT -> JFCB but there is no field within the JFCB for the name. ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)