3

I'm trying to tag ASCII files on z/OS host shell, so we do not have to specify the code page on the command line.

> echo > iso.txt
> chtag -t -c 819 iso.txt
> vi iso.txt

Type in "Hello" then quit and save

> ls -T iso.txt
t ISO8859-1   T=on  iso.txt
> od -x iso.txt
0000000000      C885    9393    9615

examining the iso.txt file shows it contains EBCDIC.

How do I set the tools to make use of the code page tag attribute? Note that explicitly specifying the code page using -W filecodeset=819 works.

4

There are support mechanisms for doing auto conversion based on tagging. To do what you’re interested in, I replicated your scenario on my z/OS 2.3 system. To accomplish what you want you can set _BPXK_AUTOCVT=ON. I repeated the provided test case and then set _BPXK_AUTOCVT=ON to demonstrate the desired behaviour worked.

$ echo > iso.txt
$ chtag -t -c 819 iso.txt
$ ls -T iso.txt
t ISO8859-1   T=on  iso.txt
$ vi iso.txt  (enter Hello, save then exit)
$ od -x iso.txt
0000000000      C885    9393    9615
0000000006

The word Hello is stored as EBCDIC despite having tagged the file as 819.
Next, setting _BPXK_AUTOCVT=ON enables auto conversion.

$ export _BPXK_AUTOCVT=ON
$ echo > iso.txt
$ chtag -t -c 819 iso.txt
$ vi iso.txt  (enter Hello, save then exit)
$ od -X iso.txt
0000000000          48656C6C        6F0A0000
0000000006

Here you can see that the auto-conversion function stored the text in the correct codeset.

References:

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.