File tagging
Marking a Unix file on z/OS with its code page and whether it is text, so it can be converted correctly when read.
Also written chtag, file tag, ls -T, automatic conversion, _BPXK_AUTOCVT
On z/OS, a Unix file might hold EBCDIC text, ASCII or UTF-8 text, or binary data. The file itself does not show which. A file tag records it: a code page, as a CCSID number, and a flag saying whether the file is text.
The chtag command sets the tag. chtag -tc 819 file.txt marks a file as text in ISO 8859-1, a form of ASCII. ls -T shows the tags of files in a directory, and an untagged file shows as such.
Tags matter because z/OS can convert text automatically when it is read. With automatic conversion switched on, a program that expects EBCDIC can read a tagged ASCII file and see EBCDIC, and the other way round. Without the right tag, the same file shows as unreadable characters.
When text in a Unix file looks garbled on z/OS, check its tag first. Wrong or missing tags are the usual cause, especially for files that arrived from another platform, for example through Git or file transfer.
Where can I learn this hands-on?
Right here, at ZedBank. You take a junior job at a simulated bank and learn each part of the work by doing it, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- Unix System ServicesA full Unix environment built into z/OS, with a shell, directories and files alongside the traditional mainframe world.
- CCSIDCoded character set identifier: a number that names which character encoding some data uses, so it can be converted correctly.
- EBCDICThe character encoding mainframes use, where letters and numbers are stored as different byte values than on a laptop.
- zFSThe z/OS File System: the type of file system that holds Unix files and directories on z/OS.
- Git on z/OSUsing Git, the version control system common on other platforms, to manage mainframe source code.