Finding DDnames in a job



High Level Assembler(HLASM) for MVS & VM & VSE

Finding DDnames in a job

Postby closerthanmost » Fri Mar 26, 2010 7:01 pm

I have a job with an INCLUDE member which can change regularly. The include member contains a large number of DDnames/datasets and I want to be able to read all the files in this member without knowing what the ddnames are beforehand. Is there anyway I can see using assembler what ddnames are included in the JCL. I know that all the ddnames start with BATR so can easily distinguish them from any other ddname in the job (steplib etc). I can't read TIOT since that appears to only hold details of DDnames that have been accessed already...RDJFCB was suggested to me, but of course you need the DDNAME in advance!

I'm sure this can be done, but I've been searching all over to try and find a way so any help would be appreciated.

Many Thanks In advance
Andy
closerthanmost
 
Posts: 3
Joined: Fri Mar 26, 2010 6:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Finding DDnames in a job

 

Re: Finding DDnames in a job

Postby Robert Sample » Fri Mar 26, 2010 8:24 pm

I can't read TIOT since that appears to only hold details of DDnames that have been accessed already
I believe the TIOT is allocated data sets, whether or not they've been opened or not. It is not that hard to write a COBOL program (or Assembler even) that follows the control blocks and extracts all DD names allocated to the step -- and should run under a couple hundred lines of COBOL.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Finding DDnames in a job

Postby closerthanmost » Fri Mar 26, 2010 9:02 pm

Thanks for the reply....you are right. I'd actually come back to update my post to say I'd sorted it. I actually managed it in assembler after I found some other code that checked the TIOT to see if a particular ddname was present. Since one of the return codes was fro file not found, it was obviously doing it before it opened, so it just required a bit of manipulation to spew out all the ddnames it found.

I'll try and post the code up later just in case it's useful for someone else.(Internet access being blocked from the office PC)

Andy
closerthanmost
 
Posts: 3
Joined: Fri Mar 26, 2010 6:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Finding DDnames in a job

Postby closerthanmost » Fri Mar 26, 2010 9:09 pm

As promised

       
         XC    EXTRACT1(12),EXTRACT1                                 
         XC    TIOTADDR,TIOTADDR                                     
         LA    R2,TIOTADDR             RETURN ADDRESS                 
         EXTRACT (R2),FIELDS=TIOT,MF=(E,EXTRACT1)                     
         SPACE                                                       
         L     R2,TIOTADDR             PICK UP THE ADDRESS OF THE TIOT
         USING TIOT1,R2                MAP THE TIOT                   
         SPACE                                                       
TIOT0010 DS    0H                                                     
         CLI   TIOELNGH,0              END OF THE TIOT YET ?         
         BE    TIOT0060                YES ... STOP PROCESSING       
         SPACE                                                       
         MVC   DDNAME,TIOEDDNM                                       
         CLC   DDNAME(4),=C'BATR'                                     
         BNE   TIOT0050                                               
*                                                                     
         MVC   ANDY1+8(3),DDNAME+4                                   
         MVC   ANDY1+12(7),DDNAME                                     
ANDY1    WTO   'DDD DDDDDDD FOUND'                                   
TIOT0050 DS    0H                                             
         SR    R3,R3                   ZEROISE R3 FOR ICM     
         IC    R3,TIOELNGH             PICK UP DD ENTRY LENGTH
         SPACE                                                 
         AR    R2,R3                   MOVE ALONG TO NEXT ENTRY
         SPACE                                                 
         B     TIOT0010                KEEP CHECKING           
         SPACE                                                 
TIOT0060 DS    0H                                             
         DROP  R2                 
         RETURN
*                                                             
EXTRACT1 EXTRACT ,,MF=L               
TIOTADDR DC    F'0'                   
DDNAME   DS    CL7                   
*                                     
         LTORG                       
         EJECT                       
TIOT     DSECT                       
         IEFTIOT1                     
*                                     
         END                         

closerthanmost
 
Posts: 3
Joined: Fri Mar 26, 2010 6:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Finding DDnames in a job

Postby Robert Sample » Fri Mar 26, 2010 10:03 pm

Congratulations on solving your problem, and thanks for posting the code.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times


Return to Assembler