View previous topic :: View next topic |
Author |
Message |
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Tue Aug 23, 2005 10:20 am Post subject: Member name associated with DDName |
|
|
I allocated the dataset ('USERA.TAOUT(T050823)' T0 DDName "OUTFILE" in the JCL:
//OUTFILE DD DSN=USERA.TAOUT(T050823),DISP=OLD
How can I get the dataset and member name (i.e. 'USERA.TAOUT(T050823)') associated with DDName "OUTFILE" in the REXX program?
Code: |
x = listdsi('OUTFILE FILE PREALLOC')
say sysdsname
sysdsname returns 'USERA.TAOUT' without the member name T050823
|
|
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
|
Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Wed Aug 24, 2005 2:28 am Post subject: |
|
|
danm,
I have having trouble opening the link provided by semigeezer due to the firewall restrictions in my shop. So, not sure what is provided there.
Anyway Here is my solution using Data Areas. For each job a TCB (Task control Block is created in memory which contains all information about the job under execution. We can retrieve the Dataset information of all datasets allocated in the JCL using the JFCB - Job File Control Block). For more information please go through the Data Area manuals.
Link ==>
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA1D304/102.1.1?SHELF=&DT=19970711132124&CASE=
I modified the BATCHPDF code provided by Doug Nadel to retrieve member name from JFCB.
Code: |
get_allocations: Procedure Expose ddname. dsname. volume.
Numeric digits 10 /* Allow up to 7fffffff */
Drop ddname. dsname. volume. memname.
tiotptr=24+ptr(12+ptr(ptr(ptr(16)))) /* Get ddname array */
tioelngh=c2d(stg(tiotptr,1)) /* Nength of 1st entry */
a=0
ddname=' '
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
If substr(tioeddnm,1,1) <>" " Then
ddname=tioeddnm
If ddname=Arg(1) Then
Do
a=a+1
ddname.a=ddname
tioelngh=c2d(stg(tiotptr,1)) /* Length of next entry */
tioejfcb=stg(tiotptr+12,3)
jfcb=swareq(tioejfcb) /* Convert sva to 31-Bit addr */
dsname.a=strip(stg(jfcb,44)) /* Dsname jfcbdsnm */
memname.a=strip(stg(jfcb+44,8)) /* Memname jfcbelnm */
volume.a=storage(d2x(jfcb+118),6)/* Volser jfcbvols (Not
used) */
say dsname.a ' ' VOLUME.a ' ' memname.a
End
End
tiotptr=tiotptr+tioelngh /* Get next entry */
tioelngh=c2d(stg(tiotptr,1)) /* Get entry length */
End
ddname.0=a
Return
/*-------------------------------------------------------------------*/
ptr: Return c2d(storage(d2x(Arg(1)),4)) /* Return a pointer */
/*-------------------------------------------------------------------*/
stg: Return storage(d2x(Arg(1)),Arg(2)) /* Return storage */
/*-------------------------------------------------------------------*/
swareq: 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
/*-------------------------------------------------------------------*/
|
Just copy this piece of code to your REXX program, and call the para get_allocations and pass your DDNAME as PARM to this.
Hope this helps,
Thanks,
Phantom |
|
Back to top |
|
 |
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Wed Aug 24, 2005 9:51 am Post subject: |
|
|
Thank you for the quick replies. |
|
Back to top |
|
 |
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Mon Jan 30, 2006 9:58 am Post subject: |
|
|
How can I get the DISP in the JCL? |
|
Back to top |
|
 |
ofer71 Intermediate
Joined: 12 Feb 2003 Posts: 358 Topics: 4 Location: Israel
|
|
Back to top |
|
 |
|
|