MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Member name associated with DDName

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Tue Aug 23, 2005 10:20 am    Post subject: Member name associated with DDName Reply with quote

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
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Aug 23, 2005 10:46 pm    Post subject: Reply with quote

http://groups.google.com/group/bit.listserv.tsorexx/msg/78d5edd11712c288
Back to top
View user's profile Send private message Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Aug 24, 2005 2:28 am    Post subject: Reply with quote

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
View user's profile Send private message
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Wed Aug 24, 2005 9:51 am    Post subject: Reply with quote

Thank you for the quick replies.
Back to top
View user's profile Send private message
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Mon Jan 30, 2006 9:58 am    Post subject: Reply with quote

How can I get the DISP in the JCL?
Back to top
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Mon Jan 30, 2006 3:03 pm    Post subject: Reply with quote

Take a look at offset 87 in the JFCB data area.

O.
________
buy glass bongs
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group