tso_command

This building block runs one or more TSO commands on the target z/OS® system with the provided options and receives a structured response.. It is not related to artifacts.

To run correctly, this building block requires environment variables. Indicate them in a .yml file. Indicate The generic environment variables for the Ansible and Python building blocks and adapt their values to your target z/OS environment. Indicate also the variables that are specific to this building block.

To indicate the TSO command to run and the variables that it needs, you can enter a var_tso_command property in the deployment method step that this building block implements, like in the following example:
actions:
    - name: RUN A TSO COMMAND NOT RELATED TO ARTIFACTS
      short_name: TSO_COMMAND 
      steps:  
      - name: TEST STEP FOR TSO_COMMAND 
        short_name: TSO_COMMAND_TEST 
        properties:
        - key: template
          value: tso_command
        - key: var_tso_command
          value: my_var_tso_command

is_artifact: False

In this example, the value of the var_tso_command property is my_var_tso_command, but it can be any other string.

The specific variables

If you specify the var_tso_command property in a step of deployment method, you must indicate the values of the specific variables that it needs.

Indicate the specific variables of this building block in an Ansible or a Python environment variables file.
Note: For Python, the entire path to this file is indicated in the --envFile argument of The Python deployment command.

The following extract shows only the variables that are used by this building block.

my_var_tso_command:
  commands:
    - LU TESTUSER
  max_rc: 4 

The variables correspond to the parameters of the Ansible module. They are explained in zos_tso_command – Execute TSO commands.

The building block execution fails if the return code of one of the commands that are listed in the commands variable is greater than or equal to the value of the max_rc variable.

If you do not indicate the var_tso_command property in a step of the deployment method, then the values of the default tso_command_default variable from an environment variables file are used.

The following example shows the tso_command_default variable:
tso_command_default:
   commands:
    - DELETE '{{ hlq }}.SEQ01'
    - DELETE '{{ hlq }}.PDS01'
   max_rc: 4

Return values

The result of each building block task is displayed in the evidence file, in The results level that is embedded in step_result.