Intermediate ISPF Editor
Part Two - Challenge #02


Learning the ISPF editor is needed to complete challenges.

Due to the editing of text being so important, this challenge is dedicated to the ISPF editor.

You may notice that some of the following content is repeated information. However, as you will be using the ISPF editor very frequently throughout the remaining challenges, the repetition is critical in order for you to feel comfortable using it.

Two Types of ISPF Editor Commands:
  1. Primary
  2. Line

You can "type" many commands within the edit session, then press Enter.
Pressing Enter results in the execution of all the typed primary and line commands.

The above comments are demonstrated using examples that follow.

  You only need to review the examples.
  No system action is required by you, only study of the examples.
  The challenge that follows assume you have a basic understanding of how to use ISPF editor.

ISPF Editor examples

  1. ISPF Option =3.4 to get ISPF Data Set List panel
  2. Enter Z99999.PDS.DATA in the panel Dsname Level field
  3. Edit (e) of Z99999.PDS.DATA
  4. Select (s) of member new creating an empty member as shown below

Data Entry

Press Tab key to place cursor on first data entry line. Type 1234567890,
tab to next line, and type lower case alphabet a to v, then enter

ISPF line numbers appeared on left (see below) as a result of action above.

Edit session profile

ISPF primary command profile controls behavior of edit session.

Any profile option can be changed. Observe the various options.

Primary command reset removes all the informational items about the edit session.

Result of reset follows:

Edit session scrolling

Observe the SCROLL ===> value above PAGE was changed to CSR below:
Most z/OS technicians prefer CSR

Why? F1 (Help) tutorial Option 7 explains

While in tutorial for EDIT SCROLLING, Option 2 is selected.

The Scoll Amount is explained.
Enter provides even more information and F3 will return to edit session.

Edit session primary and line commands

Several commands are typed (without enter) below
Primary command - cols
Line command - i - on line number will insert 1 line
Line command - r50 - on line number will replicate that line 50 times.

Enter executes the primary and line commands with result below.

Tab and space bar was used to position cursor into blank line
I am going to win this contest! was typed
Line command d99 on line 6 will delete 99 lines that follow

Move m line 1 after a line2
Change c 'uv ' to 'uvwxyz' all occurrences

Result of move/after and change all

Move a block of lines mm to mm, after a the last line

Result of move block of lines after last line

reset and copy c line 2 after a line 6

The copy/after did not execute because reset cancelled that execution

copy c line 2 after a line 6

This time the copy/after worked
An insert i was placed in the Top of Data line area

Data entered on the newly inserted line

Copy c line 1 and overlay a block of lines oo to oo with line 1
Change c 'First' to '1st' all occurrences

Result of line commands copy/overly and primary command change all
Overlay only overlays blank spaces - see last line

Line command to shift right a block of lines ))4 to )) by 4 spaces

Result of shift right a block of lines by 4 spaces

The above examples scratch the surface of the ISPF Editor capabilities.

  • The contest challenges are an opportunity to learn more ISPF Editor techniques.
  • ISPF Editor (F1 - Help) Tutorial has excellent explanations and examples.
  • As demonstrated in Part One, ISPF Editor Macros are easy to create for repeated use.
  • ISPF Editor can be used on very large data sets.
Note: Pay attention in the instructions between Type and Enter wording in these challenges.
Instruction to "type" means that you should NOT press the enter key after typing command or text.
Instruction to "enter" means you should press enter key.


Successful completion of the challenge will create member #02 in P2.OUTPUT

Preliminary Information

  • All data is stored in binary (bits).
  • A binary bit is either 0 or 1.
  • A group of 4 bits forms a hexadecimal value between x'0' and x'F'.
      A byte consists of 8 bits.
      A byte historically is the number of bits used to encode a single character of text in a computer, since it is the smallest addressable unit of memory in many computer architectures.
      A single character of text is represented by a combination of 8 bits or 2 hexadecimal characters.
  • Hexadecimal is a standard to represent data characters.
  • Hexadecimal is used to represent EBCDIC character formats.
  • Hexadecimal is used to represent ASCII character formats.
  • EBCDIC data character format is the default in z/OS.
  • ASCII data character format is the default in some other operating systems.
  • z/OS by default stores data in EBCDIC format.
  • z/OS can store both EBCDIC and ASCII formatted data in data sets.

The challenge will explore hexadecimal, EBCDIC, and ASCII using the ISPF Editor.

Edit e Z99999.P2.OUTPUT and follow the instructions below to complete this challenge.

You may encounter an "Edit Entry" panel when opening a data set.
Simply press Enter to proceed to the ISPF edit session.

Enter the following to create a new member in P2.OUTPUT partitioned data set.
s #02

While in edit on the new #02 member, enter
copy ''

  1. Some data is readable and some is unreadable
  2. The data is a mix of EBCDIC and ASCII
  3. Enter primary command source ascii
  4. Data previously unreadable is now readable and data previously readable is now unreadable
  5. Enter primary command reset
  6. Toggle between source ascii and reset to view differences

z/OS can store and process ASCII, eventhough the z/OS default is EBCDIC.

Enter primary command hex on

  • hexadecimal value is visible for each character regardless of ASCII or EBCDIC
  • hexadecimal values are vertical immediately below the character, example EBCDIC Q character on line 6 is hexadecimal x'D8'
  • hexadecimal value x'20' is an ASCII space
  • hexadecimal value x'40' is an EBCDIC space

Click URL below and scroll forward to review the translation table which is needed to complete the challenge.
ASCII or EBCDIC Translation Table.

Enter primary command hex off

Enter line command hx on any line number to display the hexadecimal values for just that line.
Enter hx again to toggle hex values off for that line.

Two modifications to the #02 member are required to successfully complete the challenge

  • Question #3 - replace ASCII yyyy with the correct year in ASCII format - easily located with an internet search using answer from Question #2
  • Question #4 - change the correct answer, IBM, from EBCDIC format to ASCII format

While the above modifications can be accomplished several ways -
What is available in ISPF Editor to accomplish the task?

  • primary command change x'##' x'##' where ## would be substituted with the appropriate from and to hexadecimal values.
  • ISPF Editor permits displayed hexadecimal values to be changed by overtyping the hex values

Make sure you press F3 or enter save on the command line to save your changes.

Congratulations! You are done with this challenge and may move on to the next one.

Next: Challenge #03

In the event you want to start over:
  • type d99 on the first line number
  • enter primary command copy ''

Moving forward in the contest, remember the ISPF Editor Summary in References drop down
and F1 to view ISPF Edit tutorial for additional assistance.