Automated Handling of Input Prompts

Job processing often requires you to react to input prompts. The NSK Agent allows you to react to such prompts automatically. You can use predefined responses to particular prompts in each NSK job. Whenever job processing reaches a prompt, the Agent searches for a predefined input. If it finds one, processing continues automatically. If no prompt handling is defined, the definitions that are made in the Job object are decisive for the continuation of how job processing. If a virtual terminal is defined in the Guardian/NSK page of the Job object, the prompt is redirected to it. The user has to act manually in such a case. If no terminal is defined, the agent assigns an EOF mark to the prompt.

Note: This function is only supported for NonStop agent environments and TACL.

Available Functions

UC4_AUTO_ANSWER Prompt description Input

Parameters

  • UC4_AUTO_ANSWER
    Function that defines the input for the prompt. You can use it once or several times in the script of an NSK job. Definitions always apply to one particular job. The agent uses the input definitions that occurred in the script until the job reaches this point. The agent searches sequentially and uses the definition that first complies with the Prompt description first.

  • Prompt description
    You can either use the full name or specify wildcards by using the ? and * characters. The * character allows you to use the same input for several prompts instead of defining separate scripting lines.

    Notes

    • Add a backslash (\) character to have the following characters be read as regular characters: \, ?, or *.
    • Do not use quotation marks
  • Input
    Represents the input that is automatically assigned to the prompt. Enter a string, a script variable or a TACL expression. You can also use <EOF!>to respond to the prompt with an EOFmark (corresponds to Ctrl Y).
    Note: Do not use quotation marks

UC4_AUTO_ANSWER_CLEAN

This function does not have parameters. Use it to invalidate all input definitions that occurred in the script so far. The agent searches all definitions starting with the script line in which you use this function. You can separate script sections in which different prompt handling should apply with the UC4_AUTO_ANSWER_CLEAN function.

UC4_AUTO_ANSWER_TRACELEVELLevel

Parameters

  • UC4_AUTO_ANSWER_TRACELEVEL
    Use this function if you require more detailed information about the search for prompt input definitions. Depending on the specified level, more detailed messages are written to the job report and the virtual terminal.

  • Level
    Number between 0 and 3

    • 0 (default)
      No output is made concerning the prompt comparison
    • 1
      A message is sent for each coinciding prompt comparison
    • 2
      A message is sent for each non-coinciding prompt comparison
    • 3
      Sends level 2 and level 3 messages

Example 1

The PURGE statement requires an input that is either y or n. The following script example explains how you can handle this input in an automated form:

UC4_AUTO_ANSWER "PURGE * (y/[n])?" y
PURGE *
UC4_AUTO_ANSWER_CLEAN

The first line defines y as the response to the prompt for the PURGE statement. Therefore, the PURGE call in the next line automatically uses y. The UC4_AUTO_ANSWER_CLEAN function that is used in the third line causes the previous input definition not to be applied for the rest of the job script.

Example 2

The following example shows an abstract of a Job report of a script that uses the UC4_AUTO_ANSWER_TRACELEVEL function.

UC4_AUTO_ANSWER "*is no prompt*" "Answer 1"
UC4_AUTO_ANSWER "*is a prompt*" "Answer 2"
UC4_AUTO_ANSWER "*is what*" "Answer 3"
UC4_AUTO_ANSWER "*is nothing*" "Answer 4"

run $data01.uc4.prompt
This is a prompt>Answer 2
Answer to the prompt received: Answer 2


UC4_AUTO_ANSWER_TRACELEVEL 1
run $data01.uc4.prompt
*** Pattern checked: "*is a prompt*", matched, answer generated: "Answer 2"
This is a prompt>Answer 2
Answer to the prompt received: Answer 2


UC4_AUTO_ANSWER_TRACELEVEL 3
run $data01.uc4.prompt
*** Pattern checked: "*is no prompt*", no match
*** Pattern checked: "*is a prompt*", matched, answer generated: "Answer 2"
This is a prompt>Answer 2
Answer to the prompt received: Answer 2