ESP Workload Automation

 View Only
  • 1.  GENTIME criteria using variable

    Posted 18 days ago

    Am I allowed to use a variable as my GENTIME criteria?

    What is the reason for my syntax error when I try to use a variable as my GENTIME criteria here?

     TRIGGERDATEWED = '08.42 TODAY PLUS 1 DAYS'
     GENTIME LW %TRIGGERDATEWED                
     IF TODAY('WEDNESDAY') THEN                
     ESPNOMSG TRIGGER DIST_WNZCELW1 +          
     AT('%LWTIME %LWDATE') +                   
     ADD                                       
     

    $$$$$$ my result $$$$$$$$
                                                                                   
     ESPMT0528E ERROR OCCURRED PROCESSING EVENT ESPM2HT.DIST_WNZCC76L IN APPL WNZCC76L.8                                                                            
     ESPMT0027E GENTIME LW %TRIGGERDATEWED                                          
     ESPMT0607E SYNTAX ERROR STARTING AT '%TRIGGERDATEWED'                          
     ***                                                                            
                    

    ^^^^^^^^^^^^^^^^^^^^^^^

    reference:

    GENTIME Command: Generate Times

    Broadcom remove preview
    GENTIME Command: Generate Times
    The GENTIME command customizes date-and-time symbols for any scheduling criteria. It may be required to use date-and-time symbolic variables other than ESP's built-in symbolic variables. Using the GENTIME command you create a set of customized date-and-time symbolic variables.
    View this on Broadcom >



  • 2.  RE: GENTIME criteria using variable

    Broadcom Employee
    Posted 18 days ago

    Hi Loren

    Can you provide a little more detail please because I have not been able to replicate your problem.  Here is a small application that I wrote to test things

    APPL LWTEST
     
    JOB JOB1 TASK SELFCOMPLETING
      RUN DAILY
     
      TRIGGERDATEWED = 'NOW PLUS 5 SECONDS'
      GENTIME LW %TRIGGERDATEWED
      IF TODAY('THURSDAY') THEN +
        ESP TRIGGER PROD002.TEST1 AT('%LWTIME %LWDATE') ADD
     
    ENDJOB
    I changed the TRIGGERDATEWED value and the day in the IF statement to better suit my test, but the principle of the thing still holds

    I can simulate the event for the appl and get no errors
    INVOKE PROD002.ESP.JOBS(LWTEST)  
     APPL LWTEST  
     JOB JOB1 TASK SELFCOMPLETING  
       RUN DAILY  
       TRIGGERDATEWED = 'NOW PLUS 5 SECONDS'  
     GENTIME LW NOW PLUS 5 SECONDS  
       IF TODAY('THURSDAY') THEN ESP TRIGGER PROD002.TEST1 AT('%LWTIME %LWDATE') ADD  
     ESP TRIGGER PROD002.TEST1 AT('00.44.45 THURSDAY MAY 30TH, 2024') ADD  
     ENDJOB  
     SIMULATION OF EVENT PROD002.LWTEST AT 00.44.40 ON THURSDAY MAY 30TH, 2024  
     JOBS: (NONE)  
     NO JOBS SELECTED FOR SUBMISSION  
        
     JOB TYPE-JOBNAME---HC-RELEASES  
     TASK     JOB1       0 (NONE)  
    And when I trigger the event for the appl, sure enough, the application runs and a few seconds later, the TEST1 application also runs


    ------------------------------
    Thanks in advance
    Chris
    ------------------------------



  • 3.  RE: GENTIME criteria using variable

    Broadcom Employee
    Posted 18 days ago

    Just to add, I also moved the variable definition and the GENTIME statement outside the job definition to see if that made a difference.  It did not.  The application is

    APPL LWTEST
     
      TRIGGERDATEWED = 'NOW PLUS 5 SECONDS'
      GENTIME LW %TRIGGERDATEWED
     
     
    JOB JOB1 TASK SELFCOMPLETING
      RUN DAILY
     
      IF TODAY('THURSDAY') THEN +
        ESP TRIGGER PROD002.TEST1 AT('%LWTIME %LWDATE') ADD
     
    ENDJOB

    and the simulation output is as follows

     INVOKE PROD002.ESP.JOBS(LWTEST)  
     APPL LWTEST  
       TRIGGERDATEWED = 'NOW PLUS 5 SECONDS'  
     GENTIME LW NOW PLUS 5 SECONDS  
     JOB JOB1 TASK SELFCOMPLETING  
       RUN DAILY  
       IF TODAY('THURSDAY') THEN ESP TRIGGER PROD002.TEST1 AT('%LWTIME %LWDATE') ADD  
     ESP TRIGGER PROD002.TEST1 AT('00.48.24 THURSDAY MAY 30TH, 2024') ADD  
     ENDJOB  
     SIMULATION OF EVENT PROD002.LWTEST AT 00.48.19 ON THURSDAY MAY 30TH, 2024  
     JOBS: (NONE)  
     NO JOBS SELECTED FOR SUBMISSION  
        
     JOB TYPE-JOBNAME---HC-RELEASES  
     TASK     JOB1       0 (NONE)  
     

    Triggering the LWTEST event runs the LWTEST appl and a few second later, the TEST1 appl is also triggered



    ------------------------------
    Thanks in advance
    Chris
    ------------------------------



  • 4.  RE: GENTIME criteria using variable

    Posted 17 days ago

    Thank you Chris. I will send more details privately.




  • 5.  RE: GENTIME criteria using variable

    Posted 17 days ago

    I moved the variable declaration and GENTIME statement prior to my APPLSTART. Initial testing suggests that might be my answer.

    Our appls have a couple standard template invokes where we are gathering all our ingredients for the current environment. Perhaps because of the way we instantiate our appls the variable was unknown to the appl gen when it was called. Declaring the variable sooner seems to make it available when needed.

    I'll keep at it Friday.