This document outlines a process you can use to find any command, parameter, or value referenced in any of your Sequel script objects.


Steps:

This method uses work files and Sequel functions (scripts and Sequel query statements).

  1. Issue the following command to create a work file containing a list of Sequel objects:
    DSPOBJD OBJ(LIB/*All) OBJTYPE(*USRSPC) OUTPUT(*OUTFILE) OUTFILE(MYLIB/OBJECTS)
    
    
  2. Create ScriptB (this script is used by ScriptA below and must be created first) with the following commands:
    10 MONMSG
    20 DSPSCRIPTD SCRIPT(yourlib/&SCPTNM) TYPE(*SRC) OUTPUT(*OUTFILE) 
                  OUTFILE(QTEMP/SCPTNM)
    30 EXECUTE SQL(‘select “&&scptnm” len(10) name(scptnm), *.1 
                    from qtemp/scptnm’) 
               OUTFILE(mylib/Scripts2) MBROPT(*ADD)
    40 DLTF FILE(QTEMP/SCPTNM)
    
    
  3. Create ScriptA with the following commands:
    10 MONMSG
    20 RUNCMD CMD(‘runscript script(yourlib/ScriptB) 
              SETVAR((_&&scptnm ‘’_&&odobnm’’))’) 
              SQL(‘select odobnm from mylib/objects 
                   where odobat contains “SQLSCRIPT”’)
    
    
  4. Run ScriptA. The following process will occur:
    • ScriptA, using the RUNCMD, will repetitively run ScriptB as many times as there are records in the OBJECTS file (created in Step 1) with an attribute of SQLSCRIPT.
    • Every time ScriptB runs, it places the command listing and the corresponding name for each script in a work file—SCRIPTS2.
       
  5. When ScriptA is finished, query the SCRIPTS2 file to find any value you like in the script’s commands using a request similar to the following:
    DISPLAY (‘SELECT DISTINCT SCPTNM, SRCDTA FROM MYLIB/SCRIPTS2
              WHERE UPPER(SRCDTA) CONTAINS “EXECUTE”’)
    This request displays each script name that contains an EXECUTE command.

 


Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: April 21, 2017