sequential_archive

This building block copies artifacts from a z/OS® sequential data set to a sequential backup data set. It creates the sequential data set if it does not exist.

It is run on the artifacts that are listed under the step that it implements in The deployment plan.

To trigger the execution of this building block, you can enter the following code in the deployment method from which the deployment plan is generated. See How to trigger the execution of a building block. The following code is an example.
actions:
    - name: ARCHIVE ARTIFACTS TO A ZOS BACKUP DATA SET
      short_name: ARCHIVE_TO_ZOS 
      steps:
      - name: TEST STEP FOR SEQUENTIAL_ARCHIVE
        short_name: TEST_SEQ_ARCHIVE
        properties:
        - key: template
          value: sequential_archive

types:
  - name: 'seq'
  - name: 'seqa'
is_artifact: True

This building block is related to the following artifact type: sequential data set. The name that you give to this artifact type corresponds to the extension of this artifact in the package file. You can freely choose this extension name.

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.

The Ansible variables

To run this building block, indicate the following specific variables in an Ansible environment variables file:
seq_spec:
  type: SEQ
  space_primary: 5
  space_secondary: 2
  space_type: TRK
  record_format: FB
  record_length: 20  

seq_spec_a:
  type: SEQ
  space_primary: 2
  space_secondary: 1
  space_type: TRK
  record_format: FB
  record_length: 15

hlq: 'NAZARE.WDEPLOY.ANSIBLE'

default_types: 'types'

types:
  - type: 'seq'
    is_binary: False
    is_sequential: True
    encoding:
      from: UTF-8
      to: IBM-037
#   is_asa_text: False
    ds: 
      prefix: "{{ hlq }}.SEQ"
      backup_prefix: "{{ hlq }}.BACK.SEQ"
      spec: "{{seq_spec}}"

  - type: 'seqa'
    is_binary: False
    is_sequential: True
    encoding:
      from: UTF-8
      to: IBM-037
#   is_asa_text: False
    ds: 
      prefix: "{{ hlq }}.SEQ"
      backup_prefix: "{{ hlq }}.BACK.SEQ"
      spec: "{{seq_spec_a}}"

Among all the variables that are shown in this extract, only some of them are used by this building block. The other variables are included so that you can copy and paste all the variables that might be relevant for other building blocks. To run this building block, you must declare the variables related to the artifact types.

Enter the name of the root that lists the types and characteristics of the artifacts to be deployed, if the building block applies to artifacts. By default, the root name is types but you can enter any other name if you define a var_type property in the deployment method step that is implemented by the building block. See The types variable.

Under this root, create a type variable for each artifact type that relates to this building block in the generated deployment plan. The value of each artifact type comes from the deployment method, where it is freely chosen.

Enter the following variables for each type variable:
  • An is_binary variable that is set to True to specify that the artifact type corresponds to a binary file. It is mandatory for all the binary files.
  • An is_asa_text variable for the artifacts that contain ASA control characters.

    If this variable is set to True, the copy will preserve ASA control characters in the destination. The default value is False.

    This variable is incompatible with the encoding variable.

    The force_lock variable is ineffective with is_asa_text.

  • A ds variable with the following embedded variables:
    • A prefix variable for the data set prefix.
    • A backup_prefix variable for the prefix of the z/OS sequential backup data set.
  • A rename_subs variable if you want to rename some artifacts for the deployment. Then, the building block will process these artifacts under names that are different from the names in the application package.
    In the following example, pattern and replace are regular expressions.
    - type: 'JCL'
      copy_by_folder: '{{default_copy_by_folder}}'
      pds:
        name: '{{ hlq }}.JCL'
        spec: "{{common_pds_text_spec}}"
        backup: '{{ hlq }}.BACK.JCL'
      encoding:
        from: UTF-8
        to: IBM-1047
      rename_subs:
      - pattern: "CDRD(.*)"
        replace: "CDRP\1"

The Python variables

To run this building block, indicate the following specific variables in a Python environment variables file. The whole path to this file is indicated in the --envFile argument of The Python deployment command.

seq_spec:
   type: SEQ
   primary_space: 5TRK
   secondary_space: 2TRK
   record_format: FB
   record_length: 20
seq_spec_a:
   type: SEQ
   primary_space: 2TRK
   secondary_space: 1TRK
   record_format: FB
   record_length: 15

hlq: 'NAZARE.WDEPLOY.PYTHON'

types:
  - pattern: .*.SEQ$
    dataset_prefix: "{{ hlq }}.SEQ"
    dataset_backup_prefix: "{{ hlq }}.BACK.SEQ"
    encoding:
      from: UTF-8
      to: IBM-037
#   is_asa_text: False
    is_binary: False
    is_sequential: True
    spec: "{{seq_spec}}"
  - pattern: .*.SEQA$
    dataset_prefix: "{{ hlq }}.SEQ"
    dataset_backup_prefix: "{{ hlq }}.BACK.SEQ"
    encoding:
      from: UTF-8
      to: IBM-037
#   is_asa_text: False
    is_binary: False
    is_sequential: True
    spec: "{{seq_spec_a}}"

Among all the variables that are shown in this extract, only some of them are used by this building block. The other variables are included so that you can copy and paste all the variables that might be relevant for other building blocks. To run this building block, you must declare the variables related to the artifact types.

Enter the name of the root that lists the types and characteristics of the artifacts to be deployed, if the building block applies to artifacts. By default, the root name is types but you can enter any other name if you define a var_type property in the deployment method step that is implemented by the building block. See The types variable.

Under this root, create a pattern variable for each artifact type that relates to this building block in the deployment plan. The value of each artifact type comes from the deployment method, where it is freely chosen. A pattern is a regular expression that selects the artifacts from their path in The application manifest file.

Enter the following variables for each pattern variable:
  • A dataset_prefix variable for the prefix of the z/OS sequential data set.
  • A dataset_backup_prefix variable for the prefix of the z/OS sequential backup data set.
  • An is_binary variable that is set to True to specify that the artifact type corresponds to a binary file. It is mandatory for all the binary files.
  • An is_asa_text variable for the artifacts that contain ASA control characters.

    If this variable is set to True, the copy will preserve ASA control characters in the destination. The default value is False.

    This variable is incompatible with the encoding variable.

    The force_lock variable is ineffective with is_asa_text.

  • A rename_subs variable if you want to rename some artifacts for the deployment. Then, the building block will process these artifacts under names that are different from the names in the application package.
    In the following example, pattern and replace are regular expressions.
      - pattern: .\*.JCL$
        dataset: "{{ hlq }}.JCL"
        dataset_backup: "{{ hlq }}.BACK.JCL"
        spec: "{{ common_pds_txt_spec }}"
        encoding:
          from: UTF-8
          to: IBM-1047
        rename_subs:
        - pattern: "CDRD(.*)"
          replace: "CDRP\1"

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.