CA Workload Automation ESP Edition

Expand all | Collapse all

Global variable value assignment question

Jump to Best Answer
  • 1.  Global variable value assignment question

    Posted 02-12-2018 08:09 AM

    Hi All,

     

    Description of problem

     

    I am trying  a difference approach of solving the same problem I having to fine tune ESP coding.

     I want  TWGASCS1  to run with global variable  FLAG1 = 'N'  and the value will only change once dataset trigger DATA1  completed.  Later job TWGSASCS1.001 will then run with  global variable FLAG ='Y' and pass it value to local variable switch.

     

    I am unable   to pass value 'Y' to my global variable in DSTRIG DATA1 . the value of  FLAG1 is still 'N'

    What am I doing wrong and how to fix it.  My codes as bellow. Kindly advice

     

    APPL TEST        

                                                    

    VSET FLAG1 N TABLE(TEST)    /* This is to initialize the value  from previous run                                      
                                                                       
    JOB TWGASCS1                                                          
      SUBAPPL TEST01   WAIT                                                
      RUN TODAY                                                           
    ENDJOB                                                                
                                                                           
    DSTRIG DATA1                                                          
      DSNAME 'ORMA001.TEST.DATA' ANYCLOSE                                  
      SUBAPPL TEST01 WAIT                                                  
      RUN WORKDAY                                                          
      FLAG1 = 'Y'                                                          
      VPUT FLAG1  TABLE(TEST)                                           /assign value 'Y' to global variable FLAG1    
      RELEASE ADD(TWGASCS1.001)                                          
    ENDJOB                                                                  
                                                                           

    JOB TWGASCS1.001                                                       
      SUBAPPL TEST01   WAIT                                                
       VGET (FLAG1) TABLE(TEST)                                            
       SWITCH = %FLAG1                                                     
       SE 'JOB2 VALUE FLAG1 = %FLAG1 AND SWITCH %SWITCH' USER(ORMA001)    /*display the value of FLAG1

     RUN TODAY                                                             
     ENDJOB        

     

    output of my display as bellow  

     JOB2 VALUE FLAG1 = N AND SWITCH N ESP(ORMA001)

     

     

     MSA                                         



  • 2.  Re: Global variable value assignment question
    Best Answer

    Posted 02-12-2018 08:50 AM

    I have used the syntax below to update a Global Variable Table

     

    DSTRIG DATA1                                                          
      DSNAME 'ORMA001.TEST.DATA' ANYCLOSE                                  
      SUBAPPL TEST01 WAIT                                                  
      RUN WORKDAY                                                           
      VSET FLAG1 'Y' TABLE(TEST)                                          
      RELEASE ADD(TWGASCS1.001)                                          
    ENDJOB     



  • 3.  Re: Global variable value assignment question

    Posted 02-13-2018 07:11 AM

    Thanks  Rick,  It worked !.  I am pretty new to ESP may I know why does VSET command work but using VPUT doesn't work ?. Correct me if I am wrong but both is use to set a value to the global variable.