ibm / ibm.ibm_zos_core / 1.3.6 / module / zos_encode Perform encoding operations. | "added in version" 1.1.0 of ibm.ibm_zos_core" Authors: Zhao Lu (@yourfuwa2015), Blake Becker (@blakeinate)ibm.ibm_zos_core.zos_encode (1.3.6) — module
Install with ansible-galaxy collection install ibm.ibm_zos_core:==1.3.6
collections: - name: ibm.ibm_zos_core version: 1.3.6
Converts the encoding of characters that are read from a UNIX System Services (USS) file or path, PS(sequential data set), PDS, PDSE, or KSDS(VSAM data set).
Writes the data to a UNIX System Services (USS) file or path, PS(sequential data set), PDS, PDSE, or KSDS(VSAM data set).
- name: Convert file encoding from IBM-1047 to ISO8859-1 for the same file zos_encode: src: /zos_encode/test.data
- name: Convert file encoding from IBM-1047 to ISO8859-1 to another file with backup zos_encode: src: /zos_encode/test.data dest: /zos_encode_out/test.out from_encoding: IBM-1047 to_encoding: ISO8859-1 backup: yes backup_compress: yes
- name: Convert file encoding from IBM-1047 to ISO8859-1 to a directory zos_encode: src: /zos_encode/test.data dest: /zos_encode_out/
- name: Convert file encoding from all files in a directory to another directory zos_encode: src: /zos_encode/ dest: /zos_encode_out/ from_encoding: ISO8859-1 to_encoding: IBM-1047
- name: Convert file encoding from a USS file to a sequential data set zos_encode: src: /zos_encode/test.data dest: USER.TEST.PS from_encoding: IBM-1047 to_encoding: ISO8859-1
- name: Convert file encoding from files in a directory to a partitioned data set zos_encode: src: /zos_encode/ dest: USER.TEST.PDS from_encoding: ISO8859-1 to_encoding: IBM-1047
- name: Convert file encoding from a USS file to a partitioned data set member zos_encode: src: /zos_encode/test.data dest: USER.TEST.PDS(TESTDATA) from_encoding: ISO8859-1 to_encoding: IBM-1047
- name: Convert file encoding from a sequential data set to a USS file zos_encode: src: USER.TEST.PS dest: /zos_encode/test.data from_encoding: IBM-1047 to_encoding: ISO8859-1
- name: Convert file encoding from a PDS encoding to a USS directory zos_encode: src: USER.TEST.PDS dest: /zos_encode/ from_encoding: IBM-1047 to_encoding: ISO8859-1
- name: Convert file encoding from a sequential data set to another sequential data set zos_encode: src: USER.TEST.PS dest: USER.TEST1.PS from_encoding: IBM-1047 to_encoding: ISO8859-1
- name: Convert file encoding from a sequential data set to a partitioned data set (extended) member zos_encode: src: USER.TEST.PS dest: USER.TEST1.PDS(TESTDATA) from_encoding: IBM-1047 to_encoding: ISO8859-1
- name: Convert file encoding from a USS file to a VSAM data set zos_encode: src: /zos_encode/test.data dest: USER.TEST.VS from_encoding: ISO8859-1 to_encoding: IBM-1047
- name: Convert file encoding from a VSAM data set to a USS file zos_encode: src: USER.TEST.VS dest: /zos_encode/test.data from_encoding: IBM-1047 to_encoding: ISO8859-1
- name: Convert file encoding from a VSAM data set to a sequential data set zos_encode: src: USER.TEST.VS dest: USER.TEST.PS from_encoding: IBM-1047 to_encoding: ISO8859-1
- name: Convert file encoding from a sequential data set a VSAM data set zos_encode: src: USER.TEST.PS dest: USER.TEST.VS from_encoding: ISO8859-1 to_encoding: IBM-1047
src: description: - The location can be a UNIX System Services (USS) file or path, PS(sequential data set), PDS, PDSE, member of a PDS or PDSE, or KSDS(VSAM data set). - The USS path or file must be an absolute pathname. - If I(src) is a USS directory, all files will be encoded. required: true type: str dest: description: - The location where the converted characters are output. - The destination I(dest) can be a UNIX System Services (USS) file or path, PS(sequential data set), PDS, PDSE, member of a PDS or PDSE, or KSDS(VSAM data set). - If the length of the PDSE member name used in I(dest) is greater than 8 characters, the member name will be truncated when written out. - If I(dest) is not specified, the I(src) will be used as the destination and will overwrite the I(src) with the character set in the option I(to_encoding). - The USS file or path must be an absolute pathname. required: false type: str backup: default: false description: - Creates a backup file or backup data set for I(dest), including the timestamp information to ensure that you retrieve the original file. - I(backup_name) can be used to specify a backup file name if I(backup=true). required: false type: bool backup_name: description: - Specify the USS file name or data set name for the dest backup. - If dest is a USS file or path, I(backup_name) must be a file or path name, and the USS path or file must be an absolute pathname. - If dest is an MVS data set, the I(backup_name) must be an MVS data set name. - If I(backup_name) is not provided, the default backup name will be used. The default backup name for a USS file or path will be the destination file or path name appended with a timestamp, e.g. /path/file_name.2020-04-23-08-32-29-bak.tar. If dest is an MVS data set, the default backup name will be a random name generated by IBM Z Open Automation Utilities. - C(backup_name) will be returned on either success or failure of module execution such that data can be retrieved. required: false type: str to_encoding: default: ISO8859-1 description: - The destination I(dest) character set for the output to be written as. - Supported character sets rely on the charset conversion utility (iconv) version; the most common character sets are supported. required: false type: str from_encoding: default: IBM-1047 description: - The character set of the source I(src). - Supported character sets rely on the charset conversion utility (iconv) version; the most common character sets are supported. required: false type: str backup_compress: default: false description: - Determines if backups to USS files or paths should be compressed. - I(backup_compress) is only used when I(backup=true). required: false type: bool
backup_name: description: Name of the backup file created. returned: changed and if backup=yes sample: /path/file_name.2020-04-23-08-32-29-bak.tar type: str dest: description: The name of the output file or data set. If dest is a USS file or path and the status has been changed in the conversion, the file status will also be returned. returned: always type: str src: description: The location of the input characters identified in option I(src). returned: always type: str