Tagging files
IBM® Open Enterprise SDK for Python supports both
EBCDIC and ASCII input files.
It attempts to autodetect file encodings, but it is highly recommended that all source files be
tagged with their correct encodings. You can use the chtag utility to tag input files that are not EBCDIC text,
which is the default encoding for input files on z/OS®.
Binary files
chtag -b <path/to/binary/file>ls -T <path/to/binary/file>b binary T=off path/to/binary/fileEnhanced ASCII support
Some applications take advantage of Enhanced ASCII support, which requires ASCII
encoded text files to be tagged as ASCII text files. Python applications on z/OS also support reading files that are tagged as
ASCII text files.
ASCII text file, use the following
command:chtag -tc ISO8859-1 <path/to/ascii/file>ASCII text file, use the following
command:ls -T <path/to/ascii/file>
t ISO8859-1 T=on path/to/ascii/fileUsage
- Create a zip file of your source files on the ASCII platform.
- Unzip the zip file on z/OS.
- Tag all text files by using the following
command:
chtag -tc ISO8859-1 - Tag all binary files by using the following command:
chtag -b
To copy files remotely from an ASCII platform to z/OS, you
can use the sftp command, which converts every file from ASCII to
EBCDIC as it copies. In this case, tagging is not necessary.
export _TAG_REDIR_ERR=txt
export _TAG_REDIR_IN=txt
export _TAG_REDIR_OUT=txtTroubleshooting
For more information about troubleshooting incorrectly tagged files, see Errors for incorrectly tagged files.