Examples

  • Using SCRPTLIB members to run non-centralized scripts:
    • In the following example, filewatch checks for any file stored in the C:\bin\my test\ path, every 15 seconds indefinitely:
      JOBREC                           
         JOBSCR('/tws/bin/filewatch -condition wcr 
                                    -f "/tmp/bin/my test" 
                                    -dea 0 
                                    -i 15')
    • In the following example, filewatch performs the first and unique loop after 30 seconds:
      JOBREC                           
         JOBSCR('/tws/bin/filewatch -c wmr 
                                    -f /tmp/bin/file01 
                                    -dea 30 
                                    -i 45')
    • In the following example, filewatch performs the last loop after 680 seconds:
      JOBREC                           
         JOBSCR('/tws/bin/filewatch -c wmc 
                                    -f /tmp/bin/file01 
                                    -dea 680 
                                    -i 45')
    • The following example shows how you can use the OXJOBNAM supplied variable. This variable is automatically set to the extended job name field, defined at operation level. It allows associating the same SCRPTLIB member to any job to be used for file watching, provided that the corresponding extended job name is set to the name of the file that has to be monitored.

      The scheduler will substitute OXJOBNAM when updating the Symphony file and the agent will substitute HOME when submitting the job. The BACKPREF('$') parameter specifies a value different from the default %, to leave this character as identifier for the variable to be substituted by the agent.

      VARSUB                           
         TABLES(TABLE01)               
         PREFIX('&')                   
         BACKPREF('$')                 
         VARFAIL(YES)                  
         TRUNCATE(YES)                 
      JOBREC                           
         JOBSCR('%HOME%\bin\filewatch -c wmc 
                                      -dea 60 
                                      -i 30 
                                      -r 125 
                                      -fi D:\temp\&OXJOBNAM')
  • The following example shows a JOBLIB member for a centralized script. Regarding the OXJOBNAM supplied variable, same considerations apply as in the previous example.
    //*%OPC SCAN                                                                    
    SET FILE= -fi &OXJOBNAM.                                                        
    SET PARM= -c wmc -dea 60 -i 30 -r 125                                           
    //*%OPC BEGIN ACTION=NOSCAN                                                     
    echo %HOME%\bin\filewatch %PARM% %FILE%                                         
    %HOME%\bin\filewatch %PARM% %FILE%                                              
    //*%OPC END ACTION=NOSCAN