'IS03.SHARE.TEXT(NCADD)' -- ART006 April 1st, 1995 6:54 a.m. -- dev(1403W8) chars(MONO) +--------------------------------------------------------+ | | | | | The Toolbox | | | | Today's topic -- HEX usage | | | | Items in this section: | | 1. JCL checking in Batch -- printed copy | | 2. Hex -- displays and usage | +--------------------------------------------------------+ ---------------------------------------------------------+- By David McRitchie (E-Mail ID - DMcRitchie@hotmail.com Today's Toolbox column will specialize in hex usage, displays, and calculations available on-site in TSO. I know most readers won't be working with HEX, so the first topic will describe how to get a hard copy of JCL checking. JCL checking The use of !EDCHEK (Jun '92 ART001) is extremely useful but sometimes a hardcopy is wanted. There are a couple of methods. 1. Run a job in BATCH The following will not provide the same style as you get using !EDCHEK online, but it can prove interesting in that the results are way beyond what you might expect. For more information see online documentation for EDCHEK (Dec '92). // EXEC CAZ1JCHK //SYSIN DD DSN=xxx.xxx.xxx(xxxx),DISP=SHR 2. Use EDCHEK and modify content in edit This method will change your data so you should only work within a temporary file or copy your data to another member and work with it there. * !EDCHEK * X all ' ' to undisplay all data lines * MDD on first and last NOTE or MSG lines. * TAGX NX * C 1 all % '---------------' * REMDUPS NX * RESET * @PRINTNX DEST(dest) HEX usage Real programmers can do octal, hexadecimal and binary math in their heads. Computer circuits work with bits which have a value of 0 (off) or 1 (on), bits are used in binary numbers (base 2). We are more used to working with decimal numbers (base 10), and don't like dealing with long strings of 0's and 1's so we group bits together. On smaller machines we originally grouped three bits together as one octal digit (base 8). We now tend to group four bits together is one hexadecimal digit (base 16). A byte is two hex digits. It takes two hex digits to represent a letter for instance which as we just said is a byte. There are four bytes in 32 bit word. Much of the arithmetic computations and transfer of data to and from registers is done with words. A 32 bit word consists of eight hex digits, a halfword then is four hex digits. A byte is two hex digits, and a nibble is half a byte or one hex digit. The letter W (capitalized) for instance is represented by one byte in hex as x'E6' in EBCDIC. In the word outside of IBM mainframes ASCII is used, the value of W is represented in hex as x'57' and translation is required for these systems to pass text files back and forth. Punched cards used BCD code and are now essentially relics of the past, a W was punched as a zone 10, or 0, and a 6 punch. In the Binary code in EBCDIC for W is 11100110. HEX ON/OFF Entering HEX on the command line in EDIT or BROWSE will provide a hex interpretation of each line. IOF also provides this ability in it's own browse. The hex interpretation is eliminated by typing HEX OFF on the command line. Hex picture strings are utilized by FIND (F) and EXCLUDE (X) in EDIT, BROWSE, and ISPF. i.e. FIND all x'FA' Macros and Clists using HEX HEXSHOW The HEXSHOW macro will interpret hex coding found for an entire member in edit. The interpretation will be in NOTELINEs. Your data will not be changed. display T h e T o o l b o x data E3888540E39696938296A7 HEXES The HEXES macro will replace hex coding for character data enclosed within *HEX%% and %% delimiters. *HEX%%The Toolbox%% %%OLD%% ----gets changed to ---- E3888540E39696938296A7 The Toolbox HEXUS HEXUS provides an interactive conversion of character to/from hex directions are supplied upon entry (TSO HEXUS). To use it you enter TSO HEXUS then identify what your input is to be converted to using C to convert to character, an X to convert to hex, or an H to convert to hex after capitalizing the input, followed by your input string. enter C, H, or X conversion, or blank to quit, on next line> C 8481A3857A40F0F161F2F761F9F340 > d a t e : 0 1 / 2 7 / 9 3 = date: 1993/01/27 P P is an interactive calculator for hex conversions. It is somewhat awkward to use so the basic instructions are shown below followed by a sample session. Enter an algebraic expression, using decimal integers and +, -, * and /. Start your expression with +, -, * or / to accumulate results. Enter the word 'HEX' to enter hex mode. Enter the word 'DECIMAL' to enter decimal mode. To end the program just hit the 'enter' key. Warning: in hex mode you must accumulate one operation at a time. Enter a question mark for help. DECIMAL ARG: 1036 1036 = 1036 = X'0000040C' DECIMAL ARG: hex HEX ARG: +8BBC +X'8BBC' = 35772 = X'00008BBC' HEX ARG: HEX in the REXX Language REXX provides the ability to do arithmetic in decimal, hexadecimal, and octal, and logical operations with bits. REXX also provides conversions to/from character representations of HEX and octal. REXX is an SAA Language (see definition of SAA). Batch programs with some ability to handle/print/convert hex The SORT provides for string constants to be supplied in HEX for field to constant comparisons for INCLUDE/OMIT. Many of the IBM utilities utilize or report in HEX in some manner and can be referred to in their own manuals. Two of our own utilities are listed below. PGM=IZ2026 Char/hex dump of any file A program that will provide a hex interpretation of records in a file is PGM=IZ2026. Various options include the ability to limit which records are printed, the number of records to be printed, printing the readable letters found when file is in ASCII. The documentation for this program can be found within TECH.INFO.TEXT(PGMIZ2). // EXEC PGM=IZ2026,PARM=('/FIRST(5),LAST(20)', // 'RANGE(1,2,4,30,99999)', //STEPLIB DD DSN=INTERNAL.UTILITY.SYS4.LINKLIB,DISP=SHR //SYSIN DD SYSOUT=*,DCB=PLIVA132 //SYSIN DD ... (your input dataset) Select rec# 1-2,4-5,30-99999 has been requested on "RANGE". In the above example record 3, records 6-29, and records past record 99999 are not in the range and are not selectable. Of the selectable records there is a further restriction that only the first 5 and last 20 records be selected. Records already printed by "FIRST" will not be reprinted by "LAST". Options exist for ASCII, SMF, and AFP input, various methods of selecting records including search, and specific data in specific byte locations. Additional options include... BEGIN() EVERY(nn) FIRST(nn) HEX NOHEX HEXED JFCB LAST(nn) LIST(nn) MAXLENGTH(nn) PSAF RANGE(l,h,...,l,h) REJECT00 RESCALE NOSCALE SCALE0 NOSKIP SMF SMF(5,20) SUPERC TIME(yydddhhmmsshh,yydddhhmmsshh) 3800 STRAND(i,l) OR(xxx) STROR(i,l) HEX (either way -- into or out of hex). For more information see TECH.INFO.TEXT(PGMIZ2) under the heading IZ2026: PGM=IZ2035 Record Reformat IZ2035 is used for selecting records and reformatting columns. There is the ability to make specifications for selection or reformatting in HEX (either way -- into or out of hex). For more information see TECH.INFO.TEXT(PGMIZ2) under the heading IZ2035: HEX Subroutines - PL/I - HEXIT and UNHEXIT conversion to/from HEX documented in IS02.TSOCONV.TEXT(HEXIT) - HEXOVUN creates over and under hex for character dumps documented in IS02.TSOCONV.TEXT(HEXOVUN) %INCLUDE for PLI programs used with TRANSLATE members in SYS8.PLILIB beginning with XLAT.... n ART006 on