JCLCheck REXX interface: How to check the DD.DDSTAT variable for statements from an instream proc
search cancel

JCLCheck REXX interface: How to check the DD.DDSTAT variable for statements from an instream proc

book

Article ID: 228060

calendar_today

Updated On:

Products

JCLCheck Workload Automation

Issue/Introduction

Using the REXX interface for JCLCheck, I need to know how to detect if a 'PROC' statement is in the raw JCL, or from an instream proc.  

Environment

Release : 12.0

Component : CA JCLCheck workload Automation

Resolution

Use the REXX variable DD.DDSTAT.  Here are sample codes to check each bit in the flag: 

if DD.DDSTAT /= 'DD.DDSTAT' then do                                            
   SPBSPEC.bit=1                                                                
   SPBPRIO.bit=2                                                                
   SPBORIDE.bit=3                                                              
   SPBORODE.bit=4                                                              
   SPBPLIB.bit=5                                                                
   SPBPINS.bit=6    /* instream Proc bit flag */                                
   SPBDATA.bit=7                                                                
   SPBDDNO.bit=8                                                                
                                                                               
   teststat = X2B(C2X(DD.DDSTAT))                                              
   say ' '                                                                      
   say 'DD.DDSTAT =' teststat                                                  
   /* CHECK for INSTREAM PROC */                                                
   IF SUBSTR(teststat,SPBSPEC.bit,1) = 1 then say 'SPEC DD (JOBLIB, JOBCAT)'    
   IF SUBSTR(teststat,SPBPRIO.bit,1) = 1 then say 'HASP /*PRIORITY CARD'        
   IF SUBSTR(teststat,SPBORIDE.bit,1) = 1 then say 'STMT IS AN OVERRIDE'        
   IF SUBSTR(teststat,SPBORODE.bit,1) = 1 then say 'STMT HAS BEEN OVERRIDDEN'  
   IF SUBSTR(teststat,SPBPLIB.bit,1) = 1 then say 'STMT CAME FROM PROC'        
   IF SUBSTR(teststat,SPBPINS.bit,1) = 1 then say 'STMT CAME FROM INSTREAM PROC'
   IF SUBSTR(teststat,SPBDATA.bit,1) = 1 then say 'STMT IS "DD *" OR "DD DATA"'
   IF SUBSTR(teststat,SPBDDNO.bit,1) = 1 then say 'STMT IS UNNAMED DD'          
   say ' '                                                                      
 END                                     

Additional Information

Variable List for the JCLCheck CAZ1REXX Program