Part One

Released in 2001, z/OS is the premier mainframe operating system. Its 64-bit architecture supports legacy (over 30 year old) software while integrating modern application designs at the same time. It has a long and rich history going back to the birth of the IBM System/360 and Operating System/360, circa 1964.

Now in version 2.2, z/OS has some newly added features that continue to add modern computing capabilities. But we're not here for bells and whistles, we're going back to the old-school with ISPF!

Log on to z/OS ISPF

To complete this challenge, you must first log on to the Time Sharing Option (TSO) environment. After connecting to z/OS with your 3270 emulator, enter:


Don't forget to replace CC##### with your unique user ID.

Note: In traditional 3270 sessions, the right CNTL key was used to send commands to z/OS. Most 3270 emulators have this command mapped to the ENTER key, but some do not. If pressing ENTER does not do anything, try pressing the right CTRL key.

This takes you to the TSO LOGON screen.

The initial password is set to ZFRIENDS. Type this in and press enter.

There is a message indicating that the current password has expired and you must enter a new password to continue.

Avoid using a password that you've used previously on this system or on any other system. Make sure your contest password is completely different than your Facebook, Google, Apple, Yahoo!, online banking, laptop/desktop, or other password.

A good password needs to:

  • Be equal to or less than 8 characters in length.
  • Contain at least one numeric character.
  • Contain at least one alphabetic character.
  • Not be a password that you've used previously on this system.

Choose a new password that follows these rules. Pay attention to the directions that appear on the screen, as z/OS requires that you enter your new password twice and you will not be able to see what you are typing.

If you make a mistake during this process, it will prompt you once again for the correct password format until you meet the requirements.

Once successfully logged in, z/OS will create some data specific to your user ID and connect you to various subsystems. Look for a message LOGON IN PROGRESS. This takes a moment, so relax and think about a happy place. After a few seconds you'll see something similar to the following.

Notice the three asterisks *** next to your cursor? This is how z/OS informs you that it's waiting for your input to continue. Press the enter key and you're on your way!

You are now presented with the ISPF (Interactive System Productivity Facility) Primary Option Menu.

Press enter to clear the copyright popup dialog.

ISPF is where the majority of your interactions with z/OS will occur. ISPF is where all the magic happens!

Customize your ISPF Environment

A frequently asked question by new mainframers goes something like this: “Is 3270 the only way to interact with z/OS?” The answer is definitely no! There are many ways to connect to the mainframe, including many with GUIs.

Rational Developer for System z (RDz) is a software product that offers an Eclipse-based integrated development environment (IDE) for z/OS. A typical RDz screen looks much different from a 3270 emulator.

If you would like to try RDz, we have included instructions on where to get it in the References Section: Acquiring RDz.

Expect to work with the CLI in Parts One and Two as the instructions are written specifically for 3270 and SSH clients. Modern interfaces like RDz are not required and technical support for contestants is very limited. The Master the Mainframe contest support team can only help you with the command line interfaces for SSH and 3270.

Returning now to the ISPF session you have just started, take note of the orientation of the command line. It is located near the bottom and begins with Option ===>.

Most z/OS system programmers prefer to have the command line at the top of the screen. Change this so anybody looking over your shoulder will think you're an old mainframe pro. On the command line, type 0 (that's a zero) and press enter.

In the ISPF Settings menu, practice navigating around by pressing the Tab key. Shift-Tab will jump the cursor in the opposite direction. The arrow keys will also move the cursor around. Pressing enter when the cursor is on a menu item will open the menu. Pressing F3 will take you back to the previous screen.

Practice navigation for a bit, then navigate to the field next to "Command line at bottom". Delete the “/” by pressing the Delete key or the Space Bar key, then press enter. The command line is now positioned at the top of the screen.

Now your ISPF environment is set up like an experienced z Systems programmer. Kurt Vonnegut once said, “We are what we pretend to be.” In other words: "Fake it 'til you make it!"

To get back to the ISPF Primary Option Menu, press the F3 key. F3 almost always takes you one screen back. Like many things in z/OS and ISPF, the F-key behavior is customizable by the user or the application, so this may not always be true, but for the majority of ISPF screens, F3 takes you back to the previous screen. If you press F3 when at the ISPF Primary Option Menu, ISPF will exit and you will be taken to the TSO READY prompt. To return to ISPF, simply type ISPF and press enter.

Logging Off (and Logging Back On)

When you want to log off of z/OS, press F3 until you arrive at the TSO READY prompt. Type LOGOFF and press enter.

You can now safely close the emulator window.

If you have done more extensive work during your ISPF session, pressing F3 from the ISPF Primary Option Menu will take you to the Specify Disposition of Log Data Set screen.

When you encounter this screen, type the number 2 in the "Process Option . . . ." field. This will inform z/OS that you wish to delete the data set without printing. Pressing enter now will take you to the TSO READY prompt where you can then enter LOGOFF. Basically you are telling z/OS that you do not care to store the log of your ISPF session.

If you do not follow this procedure and log off properly, the next time you attempt to log on, you will likely encounter an ugly IJK56425I LOGON rejected error message.

If this happens to you, do not panic. Take 5 deep breaths and calmly remind yourself to end your session normally next time. Next, type in the command LOGON and press enter, then supply your user ID at the next prompt.

Once at the TSO/E LOGON screen, type in your password but do no press enter yet. Tab down to the field next to -Reconnect and type an S. Now press enter.

Voilà! You're back in business. Press enter at the IKT00300I LOGON RECONNECT SUCCESSFUL prompt and you will be back at home, sweet ISPF home.

Note: If you end a session without logging off, your ISPF customizations may not be remembered. Take 5 deep breaths and calmly remind yourself to end your session normally next time, then perform the ISPF environment customization tasks again.

If you ever find that this procedure does not work for you, try waiting 3 minutes before attempting to log back on. z/OS is configured to automatically log your session out if your connection is idle after 3 minutes.

Also, if you are logged in and do not perform any action for 30 minutes, z/OS will disconnect you. Perform the standard reconnect procedure to log back on.

Now that you know how to get connected and stay connected, let's keep going.

Use ISPF To Manipulate Data Sets

Being able to manipulate data is a fundamental task that all users of any operating system must learn to perform.

Files in z/OS are called data sets. There are several different types of data sets. One commonly used type is called a sequential data set, and can be thought of as similar to a flat file in Linux or Windows. The basic difference is records in a data set have a predefined logical length whereas Linux or Windows commonly use control bytes like the newline (\n) to differentiate records. Another type of data set is structured in a way to contain "members". These data sets are z/OS's equivalent of a folder or a directory. A data set containing members is defined as either a Partitioned Data Set (PDS) or a LIBRARY (also known as PDSE). No nesting PDS's or LIBRARIES allowed!

Another type of data set commonly used for random access is called a Virtual Storage Access Method (VSAM) data set. One variation of a VSAM data set is called a linear VSAM data set. Linear VSAM data sets are often used to store DB2 relational databases. As you will learn in the z/OS Unix challenge later in Part One, z/OS also supports POSIX filesystems. POSIX filesystems are actually stored inside a data set. There are two types of z/OS data set that store Unix filesystems: Hierarchical File System (HFS) and a newer type called zFS. A zFS data set is actually structured internally as a VSAM linear data set! HFS or zFS data sets are mounted at directories called mount points and a z/OS system may have hundreds of HFS or zFS data sets mounted, each one containing hundreds or thousands of directories or files.

Data sets in z/OS are named according to a strict set of rules. You can read about them at the IBM Knowledge Center: z/OS data set naming rules

From the ISPF Primary Option Menu, type 3 at the command line and press enter to go to the Utilities panel.

On the Utility Selection Panel, select option 4 (Dslist) and press enter.

Several data sets have already been created for you by the contest organizers. To take a look at them type CC##### next to "Dsname Level" and press enter.

ISPF will present a list of all the data sets begin with your user ID. These data sets belong to you and cannot be viewed or modified by any other contestant.

To view the contents of a member, you must first browse the PDS or LIBRARY that contains the member. From there, you are able to browse the member itself. Let's have a look at a member of your LIBRARY named CC####.DATA that contains some information about our favorite enterprise-class mainframe, and the machine you are currently talking to, the IBM z13. Tab down to the field next to CC#####.DATA and type B (for browse).

Pressing enter will take you to into the LIBRARY and lists all of the members within. Tab down to the field next to Z13 and type B.

Pressing enter opens the member in read-only mode, a result of using the Browse command to open the LIBRARY. The contents of the Z13 member is some juicy information about the super-chill, refrigerator-sized computer that you are currently interacting with.

Scroll up, down, left and right on the screen, using the F7, F8, F10 and F11 keys. You may find that the scroll wheel on your mouse performs the same Up/Down function as the F7 and F8 keys.

You've just learned how to navigate into data sets and members, way to go!

Change the Width of the 3270 Client

In the Connectivity Guide, you set your 3270 client to Model 4. Now you will set the client to Model 5.

Press F3 until you're back to the ISPF Primary Option Menu, then either Press F3 or input =X to return to the TSO READY prompt. From this screen, type logoff. Once logged off, follow the same steps as described in the Connectivity Guide to change your client to use Model 5. For example, using the Linux workstation x3270 client:

Once you have done this, reconnect to ISPF. You may notice that your screen is now wider.

Open the ISPF Settings again by entering 0, scroll down (remember to use F8), then change the "Screen format" option to 1 (Data) and press Enter.

The DATA screen format is used to display information in ISPF based on the width of the data itself. This option is only used in 3270 model 5 terminals.

Return to the ISPF Data Set List Utility (Primary Option Menu → 3 → 4), and list your data sets again. Enter B (Browse) next to CC####.DATA.

Enter B next to the Z13 member and note that the ISPF editor is expanded to fill the entire screen width.

Side Note: This feature is handy in specific situations but as you may have already noticed, not every ISPF panel can display at 133 character width. There is no requirement for you to use Model 4 or Model 5 in this contest, so user discretion is advised. The rest of the ISPF screenshots in Part One utilize Model 4.

Create a New Member

At the moment, all of your data sets contain data that the contest planners placed for you. Next you will learn how to create your own data set. A PDS or LIBRARY member can contain any type of data: flat text, binary executable code, program output, whatever you want! Now you will create a simple flat text member.

Note: Data sets are named with 1 to 8 character identifiers separated by periods, like this:

When you are creating or editing new members, z/OS automatically assumes that you want the first identifier on the left (also called the High-Level Qualifier (HLQ) to be your user ID. If you want to explicitly indicate a data set that does not start with your user ID as the HLQ, place quotation marks around the entire data set name, like this:


From the ISPF Primary Option Menu, select option 2 (Edit). This will take you to the Edit Entry Panel.

You are required to create a member inside your CC#####.DATA LIBRARY. Tab down until your cursor is next to Name . . . and type in DATA, then in parentheses enter your first name. If your name has more than 8 characters, use only the first 8 characters. In this example we use the name Lovelace; you should use your own name.

Press enter to continue. z/OS creates a new member in the CC#####.DATA data set and automatically opens the member in the ISPF editor.

Now you are prepared to experience the ISPF editor. By the way, there are 100 kinds of people in the world: People who can or cannot edit from a console, and people who do or do not understand binary to decimal conversions.

An Introduction to the ISPF Editor

Inside the newly created member, tab down to the first blank line and enter the following sentence, replacing <name> with your name!


Press enter. Notice how all the blank lines are removed, and the single line is now numbered? Many aspects of z/OS, including the ISPF editor are very efficient in the use of disk and memory storage. The ISPF editor will remove empty lines automatically. If you want to have a blank line, you actually have to type a space into the line to preserve it.

Next, place your cursor in the numeric area to the left of the line you just created and type the command: I2

Pressing enter creates two new blank lines below the line you entered the command on. Type a single space on the first blank line, and then tab to the second blank line and enter the following text:


Press enter and note the two new lines are now also numbered. Also note that the editor created a new blank line for you to continue to enter input. Finish out the haiku now.


You are free to change the haiku text to an original ode of your creation. If it's entertaining enough the contest team will post it on the Master the Mainframe social networks, giving you all the credit!

Next, you are going to replicate your amazing haiku to create 50 copies.

On the line command next to the first haiku line, type RR and and in the line command area next to the last line of the haiku, type RR49.

Press enter to apply the line commands.

Well done! The mainframe will appreciate your creativity. Press F3 to exit the editor. Don't worry, the editor always saves any changes to a data set when you F3 out. If you ever want to exit an editor session and cancel all of your changes, you would use the primary command CANCEL.

Oops! We forgot to tell you about one final bit of data that needs to be in that data set member! This time, you will edit it from the DSLIST utility. Since you now know the path to the ISPF Data Set List Utility is Primary Option Menu → 3 → 4, you can simply enter =3.4 into the ISPF command line. =3.4 is a shortcut that will always take you to the Data Set Listing Utility, no matter where you are in ISPF!

Note: In general, you can enter =3.4 followed by one blank on any input field within any panel.

In the Data Set Listing Utility panel, your user ID should still be listed in the Dsname Level field. If not, type it in again. Press enter, tab down to the field next to CC#####.DATA, and type E for edit.

Press enter, tab down to the field next to the data set member with your name, and type E for edit.

Press enter to open the member in the ISPF editor.

To the right of the command line, you will notice the scroll field which allows you to specify a scroll amount. Set to PAGE, F8 and F7 scrolls an entire page's worth of contents. That's kind of a lot, so let's change that. Place your cursor in the field and overtype PAGE with CSR, then press enter. CSR stands for cursor and tells the ISPF editor to advance to the position of the cursor when scrolling. Now, when you use the F8 and F7 keys, the editor will scroll only as many lines as it takes to make your cursor position the top or bottom line, respectively.

Note:The F1 key is the standard ISPF Help key.

For example, to find all the available options for Scroll ===> type something invalid such as XAGE into the scroll field and press enter. Pay attention to the yellow error message at the top right.

Pressing the F1 key at this point will give you hints on what is valid input.

When you do not have an error message displayed, you can find out all sorts of things about the ISPF Editor by simply pressing the F1 key, which will present you a menu of topics numbered 0 through 18. Reading through all these topics is guaranteed to make you an ISPF editor expert!

Before continuing, ensure that you have a valid scroll amount set. We recommend CSR.

Using the F8 key, scroll down to the bottom of the data. Insert three lines with the I3 line command at the end of the data.

Enter a blank space on the first new blank line, then on the final two lines, enter your school's name and your home town.

Press enter to preserve the new additions and then press F3 to back out of the editor. Remember: Pressing F3 to exit the editor ALWAYS saves.

Running a Program

In ISPF you can start a program with the TSO EXECUTE command, or TSO EXEC for short. This can be entered into any Command or Option line within ISPF. You could also exit to the TSO READY prompt and then use the EXEC command. However, there is a 3rd way which is preferred by most Mainframe Masters. ISPF has a TSO command panel that lets you issue TSO commands directly from ISPF without having to exit to the TSO READY prompt and also stores a history of previously entered commands. The ISPF Command Shell can be found by entering 6 at the ISPF Primary Option Menu, or by entering the =6 shortcut command from anywhere in ISPF. Go there now.

In the blank text field, type the following command, where <name> is the name of the member you just created. Make sure to include all the quotes:


Press enter. If all goes as expected, you'll see some messages indicating that some processing is occurring. Remember to press enter when you see ***.

When processing completes, use the Data Set List Utility (=3.4) to browse to your CC#####.P1.OUTPUT data set. You will see a member that was just created called COUNTOUT. You can browse the member to see what the output from the 'ZOS.PUBLIC.REXX(COUNT)' program is.

That's it for ISPF in Part One! Next we will log onto z/OS using SSH and explore a bit of the bash shell environment. Fire up your secure shell software, and get ready to bash!

Next: z/OS Unix