Michael_Lowry

How to use GENERIC jobs

Discussion created by Michael_Lowry on Feb 15, 2018
Latest reply on Apr 17, 2018 by Luu Le
I wanted to expand on the earlier discussion on GENERIC jobs.

The v12.x documentation offers no explanation whatsoever of how to use Generic jobs. To learn a bit more, we have to go back to the v11.2 documentation. There, the page on Generic jobs tells how to specify the agent where a generic job should run: using the &AGENT# variable¹. How does one set the &AGENT#variable?

After several tests, I could not find a way to make Generic jobs work by setting the &AGENT#variable¹ in the pre-process of the generic job. The Generic job will switch correctly to the specified agent only if the &AGENT# variable has been set earlier, during the activation phase of task execution.

The following ways of setting the variable work OK:
  • Object variable&AGENT#inVariables & Promptsof the generic job;
  • Prompt set variable&AGENT#in prompt set added toVariables & Promptsof the generic job;
  • Object variable&AGENT#in the task properties of the generic job within its parent workflow;
  • Object or script variable&AGENT#in the calling task, if the generic job is executed viaACTIVATE_UC_OBJECTwith thePASS_VALUESoption; or
  • Input variable&AGENT#read from the prompt/read buffer using the:READcommand:
    • when passed to the job via a parameter in an EXEC VARA, or
    • when passed to the job via the set using:PUT_PROMPT_BUFFER in the calling task,
      if the generic job is executed via ACTIVATE_UC_OBJECT.
The following ways of setting the variable do not work:
  • Script variable&AGENT#in the pre-process of the job (via :SETcommand);
  • Job attributeHOSTin the pre-process of the job (via :PUT_ATTcommand);
  • Curly-brace-style VARA object reference in object variable&AGENT#inVariables & Promptsof the generic job²; or
  • Predefined system or object variable in object variable&AGENT#inVariables & Promptsof the generic job³.
Notes:
  1. The v11.2release notesalso mentions the&OVERWRITE_AGENT#variable, but provides no explanation how the two variables differ. (Acommentby Jennifer_Jinhong_34 suggests that the latter variable is related to ARA.) My testing revealed that one can specify the agent where a generic job should run using either the&AGENT#variable or the&OVERWRITE_AGENT#variable. If both are set,&OVERWRITE_AGENT#takes precedence.
  2. Yes, I actually tried this. I created an EXEC VARA to look up the agent name dynamically. Neither this nor looking it up from a static VARA worked. The following error appeared:
    U00000009 '{UC4.RESOLVE_AGENT_GROUP.VARA_EXEC,,1}': Access denied
    Interestingly, VARA object referenceswere correctly resolved inother object variable values— just not in&AGENT#or&OVERWRITE_AGENT#.
  3. I also tried passing the agent name via the&ARCHIVE_KEY1#predefined variable. This resulted in
    U00007074 Error during generation. A Job object of the type GENERIC may only change to an OS-platform job.
    It seems that variable resolution is simply not performed on the contents of the&AGENT#and&OVERWRITE_AGENT#object variables.

Outcomes