Re: REXX : how to determine the member name of a DD card
- From: karolf@xxxxxxxxx (karolf Gazeta.pl)
- Date: 8 Sep 2010 04:13:16 -0700
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
.
- Prev by Date: Re: Visibility of New Volume in Storage Group
- Next by Date: Re: Visibility of New Volume in Storage Group
- Previous by thread: Re: RMM Volume Delete fails.
- Next by thread: Re: REXX : how to determine the member name of a DD card
- Index(es):
Relevant Pages
|