How to determine a JCL statement type using the REXX program interface
search cancel

How to determine a JCL statement type using the REXX program interface


Article ID: 230785


Updated On:


JCLCheck Workload Automation


Currently JCLCheck REXX variable name DD.DDSTAT provides flags that indicate information about a DD statement.   We need the same flags for all JCL statements. 


Release: 12.0

Component: JCLCheck Workload Automation


PTFs  LU03796 and LU04182 provide a new REXX variable name '$CA.STMTSTAT' to help determine the JCL statement type.

$CA.STMTSTAT is set for all statements.  Here is a sample code that will write out the value of  $CA.STMTSTAT, and the meaning of the bits that are set. 

if $CA.STMTSTAT /= '$CA.STMTSTAT' then do                                      
  SPBSPEC.bit=1    /* don't check            */                                
  SPBPRIO.bit=2    /* HASP  *PRIORITY CARD   */                                
  SPBORIDE.bit=3   /* STMT IS AN OVERRIDE    */                                
  SPBORODE.bit=4   /* STMT HAS BEEN OVERRIDDEN */                              
  SPBPLIB.bit=5    /* STMT CAME FROM PROC    */                                
  SPBPINS.bit=6    /* STMT CAME FROM INSTREAM PROC */                          
  SPBDATA.bit=7    /* STMT IS "DD *" OR "DD DATA" */                           
  SPBDDNO.bit=8    /* STMT IS UNNAMED DD     */                                
  teststat = X2B(C2X($CA.STMTSTAT))                                            
  say ' '                                                                      
  say '$CA.STMTSTAT =' teststat                                                
  IF SUBSTR(teststat,SPBSPEC.bit,1) = 1 then say 'SPEC DD '                    
  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 ' '