EBCDIC text files can be directly edited in VEDIT, without having to translate them. This is best for EBCDIC files which will subsequently be transferred back to the mainframe computer.
How to Directly Edit an EBCDIC Text File
- Open the file in the usual manner, e.g. with FILE > Open.
- If you can immediately read the file after opening it, (i.e. it is not initially unreadable), then it is not an EBCDIC file. Files transferred from a mainframe are sometimes already translated to ASCII. (Although often not correctly translated.)
- Press Alt-D (the hot-key for VIEW > Toggle display mode ) eight times to toggle to the “EBCDIC” display mode, as indicated on the status line.
- The text should now be readable, although the lines (records) many not align correctly.
- epending upon whether the EBCDIC file has lines ending in ASCII Carriage-Return / Line-Feed (hex value 0D / 0A) or in EBCDIC Line-Feed (hex value 25), or has fixed-length records, you may need to change CONFIG > File handling > File type.
- If the EBCDIC lines end in ASCII Carriage-Return / Line-Feed, vEdit should have automatically detected this and set the File type correctly. The lines should already be aligned on the screen.
- Many EBCDIC files have fixed-length records, and you may have been told what the record length is. Set CONFIG > File handling > File type to the record length. You can also deduce the record length with some experimentation.
- Although rare, some EBCDIC lines end in EBCDIC Line-Feed. You can try setting CONFIG > File handling > File type to “4” to see if this aligns the lines on the screen.
You can now directly edit the EBCDIC file. Although the EBCDIC file itself has not been translated or changed in any way, it now appears normal and can be edited in vEdit like a normal file.
In “EBCDIC” mode, vEdit acts just as if you were editing the file on a mainframe computer. When you save the file, it is still an EBCDIC file which can be uploaded back to a mainframe. It is so easy to directly edit an EBCDIC file in vEdit that you might be wondering what the fuss is all about.
To let you easily edit EBCDIC files, vEdit performs invisible translations:
- As each character in the file is displayed, it is translated to ASCII so that it displays in readable form on the screen. The file is not changed.
- Each character entered on the keyboard is translated from ASCII to EBCDIC so that the correct character is entered into the EBCDIC file. Therefore, when you type “A”, you will see “A” on the screen, even though the EBCDIC equivalent was entered into the text.
Since ASCII and EBCDIC have somewhat different character sets, not all characters will translate correctly. Therefore, if you translate a file to EBCDIC and then back again to ASCII, you may not have the same file again. Some punctuation, e.g. “[”, “]”, “|”, and many control and graphics characters will have changed.
Related Resources