search cancel

CA Repository for zOS WebStation Option SQL query to determine Job(s) based on MVS file names

book

Article ID: 42500

calendar_today

Updated On:

Products

Repository

Issue/Introduction

Question:

I wanted to understand if we can have a WSO query to get to the jobs using a particular dataset or file name? Currently we have the below Query to see the files being used in a particular job. Is it possible to see vice versa?

 

SELECT DISTINCT DS.ENT_ID,DS.MVS_NAME AS "FILE NAME",  C1.JOB_STEP_NAME                          

     FROM                                                 

     DBXREL30.DBX_XREF X1,                                

     DBXREL30.DBX_XREF X2,                                

     DBXREL30.DBX_XREF X3,                                

     DBXREL30.DBX_SYS_JOB_STEP C1,                        

     DBXREL30.DBX_PLN_MVS_DS DS,                          

     DBXREL30.DBX_SYS_STEPFILE S1                         

     WHERE                                                

X1.TARGET_ID = DS.ENT_ID                                  

AND X1.SOURCE_ID = S1.ENT_ID                               

AND X1.ENT_TYPE = 25105                                   

AND S1.ENT_ID = X2.ENT_ID                                 

AND X2.ENT_TYPE = 25106                                   

AND X2.SOURCE_ID = C1.ENT_ID                               

AND C1.ENT_ID = X3.TARGET_ID                              

AND X3.ENT_TYPE = 263                                     

AND X3.SOURCE_ID = ?                                      

 

Answer:

Yes, define a subordinate search object that connects to MVS FILEs and define the following SQL statement.  

SELECT DISTINCT J.ENT_ID,J.JOB_NAME,J.STATUS,J.JOB_TYPE

     FROM                                             

     DBXREL30.DBX_SYS_JOB J,                            

     DBXREL30.DBX_XREF X1,                              

     DBXREL30.DBX_XREF X2,                              

     DBXREL30.DBX_XREF X3,                              

     DBXREL30.DBX_SYS_JOB_STEP C1,                      

     DBXREL30.DBX_PLN_MVS_DS DS,                         

     DBXREL30.DBX_SYS_STEPFILE S1                       

     WHERE                                            

X1.TARGET_ID= ?                                       

AND X1.SOURCE_ID = S1.ENT_ID                          

AND X1.ENT_TYPE = 25105                               

AND S1.ENT_ID = X2.ENT_ID                             

AND X2.ENT_TYPE = 25106                               

AND X2.SOURCE_ID = C1.ENT_ID                          

AND C1.ENT_ID = X3.TARGET_ID                           

AND X3.ENT_TYPE = 263                                 

AND X3.SOURCE_ID = J.ENT_ID                           

Note: 

Change DBXREL30 to your repository creator

 

Additional Information:

Refer to the WebStation Option Administration Guide located here 

Environment

Release: DATASH00200-7.1-Repository-Webstation Option
Component: