Editing ASCII files on z/OS
XML and Java™ properties files are normally stored
in the HFS (UNIX) file system in code page
ISO8859-1
(ASCII). Here are several approaches for editing ASCII files on z/OS®.
- Convert the file from ASCII to EBCDIC before you edit it, then convert it back again when done.
For example:
Use the oedit program instead of vi if you are using a 3270 OMVS shell.iconv -f ISO8859-1 -t IBM-1047 myfile.properties > myfile.properties.a vi myfile.properties.a (or oedit if under a 3270 OMVS shell) iconv -f IBM-1047 -t ISO8859-1 myfile.properties.a > myfile.properties
The
atools
package, which is available from the IBM® UNIX Tools and Toys download site, provides small shell scripts that automate this process. - Tag the file as ASCII text then enable automatic
conversion.
You only have to tag the file once. Thechtag -tc ISO8859-1 myfile.properties export _BPXK_AUTOCVT=ON vi myfile.properties
_BPXK_AUTOCVT=ON
environment variable enables automatic conversion.Be careful to not set
_BPXK_AUTOCVT=ON
in your Java VM process because the VM does not expect automatic conversion of properties and XML files.For more information, see z/OS enhanced ASCII Functionality.
- Edit the file in an IDE, such as Eclipse, then deploy it to z/OS by using an Ant script and the Ant FTP task.
For more information about the Ant FTP task, see http://ant.apache.org/manual/Tasks/ftp.html.
The JZOS Cookbook, available on developerWorks®, includes an example Eclipse project and guided instructions on using Eclipse as an IDE with z/OS Java: http://www.ibm.com/developerworks/community/groups/service/.
- ISPF supports ASCII editing of HFS or zFS files.