Line Hex Editor
The Line Hex Editor enables you to view and edit the hexadecimal representation of a sequential data set or PDS member directly in VS Code. This is an advanced capability available with an active license.
When you open a remote sequential data set or PDS member in VS Code through Zowe™ Explorer or the z/OS Resources Table, it is converted from its source encoding, such as an EBCDIC code page, to a local encoding that VS Code supports, UTF-8 by default. For most programs, this conversion is clean. However, for binary data modified at the byte level, the conversion can corrupt the data. Any edits written back to z/OS® are therefore based on corrupted content.
The Line Hex Editor avoids this problem by keeping the data in its original binary representation throughout the entire edit lifecycle: download, edit, and upload. You work directly in the source encoding at all times, with no intermediate conversion that might alter the bytes.
The editor displays a single line at a time in both its decoded characters and its raw hex values side by side. Both representations are editable with live previews: changes to the hex values are immediately reflected in the character row, and changes to the characters are immediately reflected in the hex row.

Opening the Line Hex Editor
You can open the Line Hex Editor using any of the following methods, each of which opens the editor at the current cursor position in the document:
- Cmd ⌘/Ctrl+Shift+P to open the command palette and run the command
>IBM Z Open Editor: Open Line in Hex Editor. - Right-click within a supported file and select Show In > Line Hex Editor.
- Right-click within a supported file and select Open Line in Hex Editor directly from the context menu.
The Line Hex Editor commands are available only for remote sequential data sets and PDS members with an FB or FBA record format. When opened, the data set or member must be associated with a supported languages: COBOL, PL/I, HLASM, REXX, or JCL. If the data set or member opens with an unsupported language association, set the correct language before you run the command. To set the language, select the language indicator in the status bar or run >Change Language Mode from the Command Palette, and then select the appropriate language.
When the Line Hex Editor opens, the associated text editor is set to read-only. This prevents simultaneous edits in both editors, which can cause synchronization issues. It also ensures that changes are made and saved through the Line Hex Editor, preserving the original byte representation of the data rather than the converted version displayed in the text editor. The read-only lock is released after you close the Line Hex Editor.
Layout
The Line Hex Editor opens in the VS Code panel. The toolbar at the top contains the following controls, from left to right:
- The name of the sequential data set or PDS member currently displayed.
- A Line input field that shows the line number currently loaded into the editor. Type a number directly or use the arrow buttons to increment or decrement the value and navigate to a different line.
- A Code Page dropdown that controls two behaviors: the code page used to decode the raw bytes into readable characters in the preview, and the encoding applied when you type a character to produce the corresponding hex value.
- A Mode toggle that lets you switch between Insert and Replace editing modes. In Insert mode, typing a character at the cursor position shifts all subsequent characters to the right and truncates characters that exceed the data set record length. In Replace mode, the character at the cursor position is overwritten.
- Undo and Redo buttons to step backward or forward through edits.
- A Save button that also acts as a dirty indicator: it is enabled when there are pending changes and disabled when the current state matches the last saved version.
- A Settings button that opens a dialog where you can enable or disable editor features. Your selections persist across sessions. See Settings for details.
- A Close button (×) that closes the Line Hex Editor. Closing the editor also releases the read-only lock on the associated text editor.

The editor displays the following content for the currently loaded line directly beneath the toolbar:
- Ruler (optional): A ruler aligned with byte positions. When enabled, the ruler appears before the character row. See Ruler for details.
- Characters: The decoded representation of the byte data, produced using the code page selected in the Code Page dropdown.
- Hex: Each byte of the line expressed as its two-digit hexadecimal representation, split vertically across two rows. The first row shows the first hex digit of each byte and the second row shows the second. For single-byte characters, the character in the preceding row aligns with the two hex digits that represent it.
A position indicator appears at the lower-left corner of the editor, under the hex rows. It shows the Col (character column) and Byte values for the active cursor position and updates as the cursor moves.
Actions
Navigation and focus
Click any character or hex digit to focus it. Focusing a character highlights the hex digits that encode it, while focusing a hex digit highlights the character that the corresponding byte(s) encodes.
Use the left and right arrow keys to move between characters and hex digits along the same row. Use the up and down arrow keys to move between rows. For example, pressing the down arrow while a character is focused moves focus to the first hex digit of the bytes that encode that character. Pressing the up arrow from a hex digit moves focus to the corresponding character in the preceding row.
Cursor sync
When cursor sync is enabled, the Line Hex Editor automatically updates to display the line at the current cursor position in the text editor. Select a different line in the text editor to update the hex view. Cursor sync also works with Find (Ctrl+F or Cmd+F). The hex view updates as you move through search results.
Cursor sync is enabled by default.
Editing
Both the character and hex rows are editable. The two rows stay synchronized as you type:
- Editing a hex digit automatically updates the character row: the modified bytes are decoded to characters using the active code page.
- Editing a character automatically updates the hex row: the character is encoded to bytes using the active code page, and the corresponding hex digits are updated.
Keyboard input behaves as follows:
Typing a character or hex digit
You can edit the hexadecimal values or characters. The hex row accepts only valid hexadecimal characters (0–9, A–F). The active editing mode, controlled by the Mode toggle in the toolbar, determines how the typed value is applied:
- In Replace mode, the focused element is overwritten with the typed value.
- In Insert mode, the typed value is inserted at the focused position, and all subsequent characters shift to the right. Characters that exceed the record length are truncated.
The Mode toggle defaults to Replace when the Line Hex Editor opens for the first time. After that, the editor remembers the last selected mode and restores it each time the editor is reopened for the remainder of the session.
Backspace and delete in the character row
Both backspace and delete replace the focused character with a space. Backspace additionally moves focus back one position; delete leaves focus at the current position.
Backspace and delete in the hex row
Backspace removes the focused hex digit and shifts the remaining hex digits back to fill the gap. Delete removes the hex digit in front of the cursor and shifts the remaining digits back accordingly.

Multi-line editing
You can edit multiple lines in the Line Hex Editor without losing unsaved changes. To switch to a different line, type a line number in the Line field, or right-click a line in the editor and select Show In > Line Hex Editor. Edits on other lines are preserved while you navigate. When you click Save, all edits are saved at the same time.
Undo and Redo work across changes on all lines. To discard all unsaved changes, close the Line Hex Editor and select Discard Edits when prompted.
Saving
Undo and Redo reverse or reapply edits. The standard keyboard shortcuts Ctrl+Z and Ctrl+Shift+Z (Windows) or Cmd+Z and Cmd+Shift+Z (Mac) also work.
To write changes to the host system, click the Save button in the toolbar or use the standard save keyboard shortcut. On save, the Line Hex Editor writes the updated bytes directly to the remote sequential data set or PDS member. If the text editor for the remote resource remains open and visible after a successful save, the Line Hex Editor automatically refreshes its contents from the host. If Preview Edits on Save is enabled, a diff view opens before the changes are saved. See Preview Edits on Save for details.
Settings
The Settings button in the toolbar opens a multi-select prompt where you can enable or disable the following editor features. Your selections persist across sessions.

Cursor Sync
When enabled, the Line Hex Editor tracks the cursor position in the associated text editor automatically. Moving the cursor to a different line in the text editor causes the Line Hex Editor to load and display that line. Cursor Sync responds only to line-level navigation and does not track the cursor position within a line. Enabled by default.
Ruler
When enabled, a ruler appears before the character row and aligns with byte positions. The ruler uses the pattern ----+-...1....+....2....+....3, where each integer marks every tenth byte and the count resets after every 100 bytes. The ruler helps identify the byte position of content within a record. Disabled by default.
Preview Edits on Save
When enabled, clicking Save opens a diff view before any data is written to the host. The left side of the diff view shows the original content, and the right side shows the updated content that incorporates the edits. Review changes across all modified lines, and then accept the changes to proceed with the save or cancel to return to the editor with the edits intact. This feature is useful for verifying changes that span multiple lines before the save operation. Disabled by default.
Code page for the hex preview
The initial code page shown in the Code Page list is determined by the same evaluation process that the Z Open Editor language servers use when parsing a remote program. The process evaluates the following sources in order:
- An encoding selected through the Zowe Explorer Open with Encoding action
- RSE API mappings
- Zowe Explorer profile encoding properties
- The
zopeneditor.encodings.filePatternsuser setting
See Specifying an EBCDIC file encoding to use with the language servers for the complete evaluation order and available configuration options.
Language association for remote data sets
To open a sequential data set or PDS member in the Line Hex Editor, the text editor must be associated with a supported language (COBOL, PL/I, HLASM, REXX, or JCL). When you open a remote data set or PDS member, VS Code lacks a file extension to rely on for language detection. You can configure language associations for remote data sets and members using the Z Open Editor data set settings or the files.associations setting with Zowe Explorer-compatible glob patterns. See Remote file associations for details.
Limitations
- Local files are not supported. The Line Hex Editor is available only for remote sequential data sets and PDS members accessed through Zowe Explorer.
- Only data sets with a record format of
FBorFBAare supported. - The text editor must be associated with one of the supported languages: COBOL, PL/I, HLASM, REXX, or JCL.
- After a successful save, the Line Hex Editor attempts to pull the updated contents from the host to refresh the associated text editor, retrying up to five times. On slower systems or networks, the text editor might not refresh automatically.