ESP Workload Automation

 View Only
  • 1.  ESP Global Variables

    Posted Mar 13, 2024 05:22 PM

    I am trying to use Global variables table to set a variable to control if a job is on REQUEST or NOREQUEST.   So, I can put one variable into the table and things work as planned but if I have two variables  (let say VAR050 & VAR060) it seems to Toggle the second variable when I only set the first variable.   

    My APPL is used ADHOC and I have 4 jobs.  Two jobs per variable.   The two jobs are "VSET VAR050 'REQUEST'  TABLE(FCGVARD3)" and "VSET VAR050 'NOREQUEST' TABLE(FCGVARD3)".   the same for the other variable VAR060.   

    Does anybody have any issues with Global Variable Tables?  We do not use GVT very much with our company.   

    Thank you for any help.   

    ps.  I also tried VPUT.  Not sure the big difference between the two in net results.   



  • 2.  RE: ESP Global Variables

    Broadcom Employee
    Posted Mar 14, 2024 05:09 PM

    Hi Don,

    Did you issue VGET to retrieve the global variable value before using it?

    There shouldn't be any problem to have two variables in the same global variable table.

    Hope this helps,

    Lucy




  • 3.  RE: ESP Global Variables

    Posted Mar 15, 2024 12:51 PM

    Lucy,  So I use VGET when I need to use the variable.   This is not an issue.  It is when I use VPUT/VSET I have issues.  I will post my code.   I only trigger the one of the 4 jobs to change the one variable. 

    APPLSTART APPLSTRT.WNZCESGV                                        
    ENDJOB                                                               
                                                                         
    /* SET VARIABLE WNZCE053_FW TO "REQUEST"                             
    JOB WNZC_D3_SET_REQUEST_WNZCE053_FW TASK SELFCOMPLETING   
        VSET WNZCE053_FW 'REQUEST' TABLE(FCGVARD3)                   
                                                                         
    /* SET VARIABLE WNZCA053_FW TO "NOREQUEST"                           
    JOB WNZC_D3_SET_NOREQUEST_WNZCE053_FW TASK SELFCOMPLETING 
        VSET WNZCE053_FW 'NOREQUEST' TABLE(FCGVARD3)                   
                                                                         
    /* SET VARIABLE WNZCE055_FW TO "REQUEST"                             
    JOB WNZC_D3_SET_REQUEST_WNZCE055_FW TASK SELFCOMPLETING   
        VSET WNZCE055_FW 'REQUEST' TABLE(FCGVARD3)                   
                                                                         
    /* SET VARIABLE WNZCA055_FW TO "NOREQUEST"                           
    JOB WNZC_D3_SET_NOREQUEST_WNZCE055_FW TASK SELFCOMPLETING 
        VSET WNZCE055_FW 'NOREQUEST' TABLE(FCGVARD3)     
     
    APPLEND APPLEND.WNZCESGV
    ENDJOB 




  • 4.  RE: ESP Global Variables

    Posted Mar 15, 2024 12:55 PM

    Here is the sample of the table

    •                                            
      * TABLE NAME: FCGVARD3     ESP SYSTEM : EST2 
      *                                            
      WNZCE053_FW='NOREQUEST'                        
      WNZCE055_FW='REQUEST'                      

    So if I trigger WNZC_D3_SET_REQUEST_WNZCE053_FW (Setting the variable WNZCE053_FW to REQUEST)  the results are below

    •                                            
      * TABLE NAME: FCGVARD3     ESP SYSTEM : EST2 
      *                                            
      WNZCE053_FW='REQUEST'                        
      WNZCE055_FW='NOREQUEST'

    Which changes 053 but also changed 055 which was not intended.  




  • 5.  RE: ESP Global Variables

    Broadcom Employee
    Posted Mar 15, 2024 01:34 PM
    Edited by Lucy Zhang Mar 15, 2024 01:51 PM

    Hi Don,

    I believe now I know the problem. The command like VSET in ESP Proc can run twice, once at application generation time, and once at process time. If you check your ESP auditlog, you should find that ALL 4 VSET ran when the application is created and then one VSET ran afterwards, together with the triggered root job.

    One way is to add IF logic, so that the VSET will only run at process time, like below:
    IF ESP_APPL_PROC THEN DO
     VSET WNZCE055_FW 'REQUEST' TABLE(FCGVARD3)  
    ENDDO

    And if the 4 TASKs are meant to change the variable values only, they may NOT be needed at all. You can trigger the event with USER1 (contains the variable name) and USER2 (contains the value) variables:
    TRIGGER ESP.GTV USER1(WNZCE053_FW) USER2(REQUEST)

    And in ESP Proc:
    APPL .....
    IF %USER1 EQ '' THEN EXIT 
    IF %USER2 EQ '' THEN EXIT 
    IF ESP_APPL_GEN THEN DO
    /* VSET will run at application generation time*/
     VSET %USER1 %USER2 TABLE(FCGVARD3)  
    ENDDO

    Hope this helps,

    Lucy




  • 6.  RE: ESP Global Variables

    Posted Mar 15, 2024 03:07 PM

    I added 

    IF ESP_APPL_PROC THEN DO 

    ENDDO 

    around each VSET job.   That worked.  thank you very much for your great help.  Have a great weekend.