Repository navigation
Expand file tree
/
Copy pathztabexport.yml
More file actions
84 lines (71 loc) · 2 KB
/
Copy pathztabexport.yml
File metadata and controls
84 lines (71 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
- hosts: vs01
collections:
- ibm.ibm_zos_core
gather_facts: false
vars:
environment: "{{ environment_vars }}"
tasks:
- name: Run REXX script
zos_tso_command:
commands:
- EXEC 'IBMUSER.ZNEXT.REXX(ZTESTA)'
register: rexx_output
- name: Display REXX script messages
debug:
msg: "{{ rexx_output }}"
- name: Encode from ebcdic to utf
zos_encode:
src: "/u/ibmuser/MYTABLE.json"
dest: "/u/ibmuser/TABLE.json"
encoding:
from: IBM-1047
to: ISO8859-1
backup: false
register: result_encoding
- name: Display fetch messages
debug:
msg: "{{ result_encoding }}"
- name: Fetch the extracted values file to the local machine
fetch:
src: "/u/ibmuser/TABLE.json"
dest: "./MYTABLE.json"
flat: true
register: fetch_result
ignore_errors: true
- name: Display fetch messages
debug:
msg: "{{ fetch_result }}"
- name: Read JSON file
slurp:
src: ./MYTABLE.json
register: json_content
delegate_to: localhost
- name: Decode JSON content
set_fact:
mytable_data: "{{ json_content['content'] | b64decode | from_json }}"
delegate_to: localhost
- name: Write JSON data to a local file
copy:
content: "{{ mytable_data | to_nice_json }}"
dest: ./mytable_data.json
delegate_to: localhost
- name: Copy processed data back to DataSet
zos_copy:
src: ./mytable_data.json
dest: IBMUSER.ZNEXT.DATA(JSON1)
force: True
encoding:
from: UTF-8
to: IBM-037
- name: process data from json_content by python
command: python3 ./json_processor.py
delegate_to: localhost
- name: Copy processed data back to DataSet
zos_copy:
src: ./data.out
dest: IBMUSER.ZNEXT.DATA(DATA1)
force: True
encoding:
from: UTF-8
to: IBM-037