ESP Workload Automation

  • 1.  REXX to generate ESP Variable

    Posted Dec 12, 2017 05:03 PM

    CA ESP EE 11.4

     

    I am trying to pass a variable generated by REXX to an NT_JOB. The REXX code works fine. It is set to parse the full file name and send just a specific value to the next wob. In this case “Kammerer”. However, I keep getting “SYMBOL ESPNAME NOT DEFINED”. Not sure what is going wrong. Any thoughts or ideas would be appreciated.

     

    I did find this on the forums, https://communities.ca.com/message/99169673 but I am not even able to create the ESP variable to pass it along.

     

    Event level file trigger

    EVENT ID(A079011.A079011A) SYSTEM(-)  REPLACE           

    CALENDAR FISCAL                                          

    INVOKE 'A079011.ESP.PROCLIB(ESPWTFL)'                    

    WOBTRIG FILE_TRIGGER Agent(SCWKLDT1) -                  

            FileName('\\D:\TEST\ERIC\kammerer\*.TXT') CREATE -

            State(Monitored) Status('Monitored for CREATE')  

    /*********************************************************************/

    APPL ESPWTFL

     

    JOB A079011A TASK SELFCOMPLETING      

      RUN ANY                             

      REXXON GEN                          

      FN=CLANGVAR('!ESPWTFILE')           

      NAME=TRANSLATE(FN, ,'-/\.',' ')     

      PARSE VAR NAME W1 W2 W3 W4 W5 W6    

      "ESPNAME=' "W4" ' "                 

      SAY 'A079011 VAR IS >>>>>>>>>>>> ' W4

      REXXOFF                             

      ECHO !ESPNAME                     

    ENDJOB          

     

    /*********************************************************************/

    OUTPUT FROM THE LOG

    A079011 VAR IS >>>>>>>>>>>>  kammerer                                     
    ESP528E ERROR OCCURRED PROCESSING EVENT A079011.A079011A IN APPL ESPWTFL.31
       ARGS /C echo !ESPNAME                                                  
    ESP2740W SYMBOL ESPNAME NOT DEFINED                                          



  • 2.  Re: REXX to generate ESP Variable
    Best Answer

    Posted Dec 12, 2017 06:02 PM

    Hi Eric, 

    I think the error comes from the REXXON GEN statement that is specified.  It actually populates the variable at GEN time and is successful. Then at processing time it fails since the REXX is not run it doesn't know the value and puts out and error.

     

    To resolve this I just used REXXON. It will process the REXX at gen time and PROC time.

     

     

    I also moved the code to a UNIX job. I think if it is in the TASK the variable will only be available in the task and not available globally for the remainder of the jobs(I didn't verify this).  My code is below.

     

    UNIX_JOB DPTEST
    RUN ANY
    REXXON
    FN=CLANGVAR('%ESPWTFILE')
    NAME=TRANSLATE(FN, ,'-/\.',' ')
    PARSE VAR NAME W1 W2 W3 W4 W5 W6
    SAY 'A079011 VAR IS >>>>>>>>>>>> ' W4
    "NAME1='"W4"'"
    REXXOFF
    AGENT AGENTU_01
    USER espadmin
    SCRIPTNAME /opt/scripts/testscripts/test_args.ksh
    ARGS %NAME1
    EXITCODE 5 FAILURE
    ENDJOB  

     

    Let me know if this doesn't resolve the issue.

     2¢

    Don



  • 3.  Re: REXX to generate ESP Variable

    Posted Dec 12, 2017 07:02 PM

    Thank you, this worked perfectly!

     

    JOB A079011A                          
      DATASET 'A079011.ESP.JCL(DUMMY1)'   
      RUN ANY                             
      REXXON                              
      FN=CLANGVAR('!ESPWTFILE')           
      NAME=TRANSLATE(FN, ,'-/\.',' ')     
      PARSE VAR NAME W1 W2 W3 W4 W5 W6    
      SAY 'A079011 VAR IS >>>>>>>>>>>> ' W4
      "NAME1='"W4"'"                      
      REXXOFF                             
      echo >>>>> !NAME1 <<<<<<            
      RELEASE ADD(A079011B)               
    ENDJOB