Skip to content

Instantly share code, notes, and snippets.

@lbdyck
Last active May 29, 2023 15:21
Show Gist options
  • Save lbdyck/81346879ceece64e446e7b465d9d5199 to your computer and use it in GitHub Desktop.
Save lbdyck/81346879ceece64e446e7b465d9d5199 to your computer and use it in GitHub Desktop.
ISPF Edit Macro to display a record in hex
/* ---------------------- REXX ----------------------------- *
| ISPF Edit Macro to display the requested record in hex in |
| an infoline. (Note: no validation is performed) |
| |
| Syntax: EHEX line |
| |
| Where EHEX is the macro name (change as you wish) |
| line is a record number |
| |
| Sample: EHEX 4 |
* --------------------------------------------------------- */
Address ISREdit
'Macro (line)'
'(data) = line' line
hex = c2x(data)
parse value '' with hextop hexbot
do i = 1 to length(hex) by 2
hextop = hextop''substr(hex,i,1)
hexbot = hexbot''substr(hex,i+1,1)
end
'line_after' line '= infoline (hexbot)'
'line_after' line '= infoline (hextop)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment