Welcome
Part One

You need a mainframe user ID before starting this contest. If you registered for the contest prior to the start date in your region, you should have already received a user ID via email. If you did not receive your ID, or if you need it sent again, please send an email to zskills@us.ibm.com. If you registered after the start date in your region, IBM will send you a user ID within a few days.

Check your regional contest page to sign up today!

The objective of Part One is to get you logged on and familiar with the various interfaces you will be using throughout the contest. As an introduction to the z/OS operating system, Part One is the 'No Experience Necessary' portion of the contest.

Note About Contest User IDs: The challenges described within use CC##### as a placeholder to describe instances where you should insert your contest user ID. Each country and geographic region participating in the contest will have their own unique prefix and each contestant will have their own unique numeric identifier. These two values combine to create a unique user ID for each contestant. Wherever you see CC##### mentioned, please change this to your specific user ID or the challenges will not work as designed.

For example, if a challenge indicates CC##### and you are participating in the China contest with an ID of CN90505, you should logically replace CC##### with CN90505.

The list of user ID prefixes for each country's particular user ID format are as follows:

RegionPrefix
IndiaIN#####
JapanJA#####
ChinaCN#####
UKIGB#####
DACHZC#####
ItalyIT#####
US & CanadaUS#####
SSAAR#####
BeNeLuxBE#####
CEEHU#####
SpainES#####
Russia & UkraineRU#####
MEAME#####
BrazilBR#####
Learning SystemAU#####

Read the instructions carefully and you will have success! Many of the terms and vocabulary used by mainframers are probably new to you. If you come across a term you are unfamiliar with, take a moment to look it up with a search engine. We recommend that you maintain a list of terms and definitions that are new and refer to it as needed.

If you experience any problems with the contest, the odds are that others are also having the same issue. Please check the following resources for help:

z Systems is the oldest general-purpose computing platform still in use today and has undergone countless design changes over the years. Today, there are many Graphical User Interfaces (GUIs) available for z Systems and they are being adopted across industries. That being said, we feel that it is important to understand what is happening behind the GUI. This contest is designed to give you these insights and as a result, your experiences with mainframe CLIs (command line interfaces) will distinguish you from your peers. In other words, be sure to put the technologies and products you learn about during this contest on your résumé! We promise that future employers are very interested to hear about your exposure.

Approximate time to completion for Part One: 1 hour

Next: Mainframe 101

Mainframe 101
Part One

We want you to know a bit about the machine and the z/OS environment you will be interacting with during the course of this contest.

The IBM z13 is the latest and greatest Enterprise-class server available and the role it plays in modern business cannot be understated.

Many of the world's largest companies process their mission critical production data on a mainframe. They chose the mainframe because of its excellent performance in reliability, availability, and serviceability (RAS). Even when parts of the mainframe inevitably fail during operation, the redundancy built into the machine ensures that important business processing can continue uninterrupted.

z Systems has an amazing history with lineage that has spanned the past 50 years. z13 is the culmination of unparalleled technical advancements and innovation of this unique computing platform we call the mainframe.

The z Systems hardware that hosts this contest is one of the most matured, reliable, flexible, secure, and function-rich platforms on the planet. The mainframe is a massive server with patented technology not found in any other computing platform on the planet.

The mainframe is the best platform for transaction processing, consolidated and secure data warehousing, and hosting enterprise-wide applications. With hardware and software optimized for high RAS, it's no wonder that 96 of the 100 largest banks, 9 of the 10 largest insurance companies, and 23 of the top 25 US retailers all rely on the mainframe to perform the mission critical processing that keeps their businesses running.

The z13 hardware can be logically carved into 85 separate partitions called LPARs (Logical PARtitions). LPAR technology enables secure multi-tenancy through which many different operating systems can be running on the same machine at the same time. z Systems LPAR is rated at Evaluation Assurance Level (EAL) 5+, making it the most trusted general purpose computing platform on the planet.

Do you care about the environment? Consider the impact carbon emmisions is having on the environment. The mainframe enables consolidation of many smaller servers leading to greatly reduced power consumption, reduced physical data center space, and reduced cooling requirements. Just think about it: you are helping to save the planet with your mainframe skills!

From legacy to Linux, assembler to node.js, console to cloud, the Mainframe does it all.

Read more about the IBM z13:

Next: Workstation Preparation

Workstation Preparation
Part One

Three crucial pieces of software are required to participate in the contest:

  1. Telnet 3270 Emulator (TN3270) - needed to communicate with many of the traditional mainframe environments like z/OS ISPF. Telnet 3270 is a block-oriented 3270 terminal emulator that can communicate over a TCP/IP network.
  2. SSH Client - needed to connect to a the z/OS Unix System Serivces shell. Similar to telnet, SSH is a cryptographically secure protocol that supports a stream-oriented connection to Unix-like environments.
  3. Web Browser - We assume you already have a web browser, as they come pre-installed in all modern operating systems. You are probably using one to read this text!

Follow the steps in the Connectivity Guide for the operating system you are using. The installation and configurations of the 3270 emulator and SSH client for Windows, Linux, and Mac are described in the Master the Mainframe Contest Connectivity Guide. Ensure that you can connect to both the TN3270 and the Unix servers before continuing.

Pause for a moment.

Inhale slowly and exhale. For those first-time contestants out there, you are taking your last breaths as a non-mainframer. May you always recall this moment fondly.

For the Master the Mainframe veterans, we hope you enjoyed the breathing exercise. Buckle up and let's get to work!

Next: z/OS ISPF

z/OS ISPF
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:

LOGON CC#####

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:
CC#####.THIS.IS.A.SAMPLE.DATASET.NAME

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:

'ZOS.PUBLIC.DATA'

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!

A HAIKU FOR THE MAINFRAME, BY <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:

QUIETLY HUMMING

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.

MAINFRAMES PROCESSING WORKLOADS
NEVER FAILING ME

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:

EXEC 'ZOS.PUBLIC.REXX(COUNT)' '<name>'

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

z/OS Unix
Part One

Unix System Services (USS) is an integral part of z/OS and is tightly woven into the operating system. Back in 1993, a previous version of z/OS called MVS/ESA OpenEdition was released that supported POSIX and other industry standards. This release included about 1 million new lines of code. OpenEdition ushered in a new era of interoperability for the mainframe by enabling a platform for existing Unix applications to be ported, and new Unix applications to be developed. When OS/390 was released in 1995, OpenEdition was renamed to Unix System Services.

Many of the modern capabilities of z/OS today would not be possible without the functionality provided by Unix System Services. Because it is so tightly integrated, most tasks that are performed in TSO or ISPF can also be achieved through USS. Conversely, many Unix tasks that are normally achieved through USS can be achieved through TSO/ISPF. This gives users an option to work inside USS or ISPF, depending on their comfort level and knowledge. For this challenge, you will use the instructions for Connecting to z/OS SSH in the Connectivity Guide to use a SSH client similar to what many Unix programmers would use.

Prepare yourself to dive into the shell and learn some basic commands!

Log onto z/OS Unix

Note: Many aspects of z/OS are not case sensitive; meaning you can enter commands and data in either UPPER or lower case. This is not so in USS. You must type commands in the proper case (usually lower).

When logging onto USS, you may enter your user ID and password in either UPPER or lower case. Your user ID and password is the same as the one you use for TSO/ISPF. They both use the same highly secure database and software that resides on z/OS.

The Connection Instructions page of the Connectivity Guide describes the steps required to connect to Unix System Services. Once you've connected successfully, you will be presented with a password prompt:

Enter your password (you just changed it in the previous section!) to complete the log in procedure. You have successfully logged into Unix when you see the a message about bash in z/OS, followed by a prompt.

Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file. Bash also incorporates useful features from the Korn and C shells (ksh and csh). source: bash(1) man page

Fundamental Unix Commands

Once logged in, you are automatically placed into your home directory and presented a command prompt. Your home directory is yours and yours alone. You are free to create, modify and delete any file or sub-directory contained within. No one else will be able to view or alter the contents of your home directory.

What follows is a list of Unix commands that every user should be familiar with. Run each of these commands as indicated.

man

"man" displays the manual for any command. If you are not sure how to use a given command or are curious as to what else it might be able to do, just type "man COMMAND". When viewing man pages, you can page forward by pressing the spacebar and Enter. Jumping to a specific page is possible by typing the page number and Enter. It's also possible to search an opened man page by typing a forward slash "/" followed by a regular expression and pressing Enter. Type the Q key and Enter to quit and return to the command prompt.

Run the following command:

man man

We recommend that you run "man COMMAND" for each of the commands listed in this section.

ls

"ls" lists the contents of the current directory. Since you are in your home directory, running ls now will show you every file and sub-directory contained there.

Run the following command:

ls -l

"ls -l" and "ls -la" are important variations of ls; try running them and see if you can tell what the difference is. Confirm your hypothesis by checking "man ls".

cat

"cat" concatenates a list of files and prints their contents to the shell. Very often cat is used to quickly display the contents of a single file. Notice the README file that was listed before? Print the contents of the README file now.

Run the following command:

cat README
more

"more" is used to browse the contents of a file. While cat is useful to view short files, it doesn't work well with long files. more to the rescue! The navigation inside more is very much like that of man, so you can use the same navigation tricks you just learned about for moving around inside the file. Use more to view the README file now.

Run the following command:

more README
mkdir

"mkdir" makes new directories. Just like the directories in other operating systems, directories in Unix are used to provide a heirarchical organization to the file system. To make a new directory, you simply pass the directory name as the first argument to the mkdir command. Make a new directory in your home directory named "bin".

Run the command:

mkdir bin

Use the "ls" command to ensure the new directory is created.

cd

"cd" changes the working directory. Your home directory can be simply referenced with a tilde or "~". To return to your home directory from anywhere else in the file system, simply execute "cd ~".

Run the commands:

cd bin
cd ~
cp

"cp" is used to copy a file or directory from one location to another. Try copying the README file to the bin directory, and rename it at the same time.

cp ~/README ~/bin/MYREADME

Use the "cd" and "ls" commands to ensure that the file was copied successfully.

echo

"echo" displays a given line of text. This is useful for prompting users for input or for displaying the contents of environment variables. For example, there is an environment variable named $USER that contains your user ID. Let's have Unix say hello to you.

Run the command:

echo Hello $USER

Note that $USER is in all CAPS.

Relative vs. Absolute Paths

Every location or node in the Unix file system can be indicated by a path. For example, the path to your home directory is "/z/CC#####", where CC##### is your user ID. This is called an absolute path because it describes a path that begins at "/", or the file system root directory. The path then goes into the z directory, inside which the CC##### directory is found. Note that your user ID in USS is all lowercase, including your home directory name.

Another way to describe locations in Unix is with a relative path. At any given time, there is always a "current working directory". A single period "." is a shorthand way to indicate the current working directory and two periods ".." describes the parent directory. If you ever wish to refer to a file or directory inside your current working directory, you can prefix the path with "./" (dot-slash). Likewise, if you wish to reference a file in the parent directory you would prefix the path with "../" (dot-dot-slash). Using relative paths enable you to traverse the file system quickly without having to always express the full path.

Note: The absolute path to the current working directory can always be known by checking the $PWD environment variable, or by running the pwd command.

File Permissions and the $PATH Variable

Time for another new command:

which

"which" will report the absolute path to any executable file that the shell can find.

Run the following commands:

which ls
which java
which iconv

How does the shell know where to search for executable files? Introducing the $PATH. The $PATH variable contains a colon separated list of paths to various directories in the file system that contain executable files. Take a look at the contents of the $PATH variable now.

echo $PATH

Whenever you enter a command, Unix searches each one of the directories in the $PATH list, in order, until it finds the command or reaches the end of the list. If a command exists in more than one PATH directory, the first directory in the list is used.

Notice that one of the paths in the list is the bin directory inside your home. This means that any program you place in your ~/bin directory can be executed without having to specify the path! Let's try this out.

Run the command:

cp /z/public/partone/finish-p1.sh ~/bin

This copies the finish-p1.sh file from /z/public/partone to your bin directory. List the contents of ~/bin to ensure that you have made a copy of the file and that it is in the correct location.

To finish this section of the contest, you must run the finish-p1.sh program. Try doing so now with the command:

~/bin/finish-p1.sh

Uh oh, permission denied! Let's take a moment to discuss how Unix file permissions work.

Each file and directory in Unix has three user-based permission groups:

  • owner: The owner permissions apply only to the single user that owns the file.
  • group: The group permissions apply to all users in the group that owns the file.
  • others: The others permissions apply to everyone else on the system.

There are three types of permissions:

  • r = Read: Permission to view the contents of a file
  • w = Write: Permission to alter the contents of a file
  • x = eXecute: Permission to run a file

Each of these three groups can have any combination of the three types of permissions. The command ls -l will display the file permissions for all files and directories in the current directory, along with the owning user and group.

For example:

-rw-r--r--.  1 CC#####  IPGROUP      270 Aug  1 20:50 finish-p1.sh
  ^  ^  ^
  |  |  |__: Other
  |  |_____: Group
  |________: Owner

Here, the CC##### is the owner, and IPGROUP is the group. CC##### has permission to read and write the file, but group and other access is limited to read only.

Your copy of finish-p1.sh should also have the same permissions, except it will be owned by your user ID. Since you are the owner, you can modify it's permissions. Time for another command!

chmod

"chmod" changes the file mode bits, which are used to describe file permissions. Without going into further detail, the following command will change the mode bits to allow you to execute the finish-p1.sh file:

chmod u+x ~/bin/finish-p1.sh

Check the man pages for chmod for additional details. If you run "ls -l" on the file again, you should see that the owner permissions are now "rwx". Try again to execute the finish-p1.sh file and pay close attention to any error messages you might receive.

If all works as designed, you will see some output indicating that your MVS data set "CC#####.P1.OUTPUT" was updated. Feel free to check it out sometime.

In preparation to complete Part One, return to ISPF via your 3270 client to perform some final actions. To exit and log off of USS, enter the command exit.

Next: Completing Part One

Completing Part One
Part One

Turning in Your Work

To let IBM know you are finished with Part One, you need to perform one final task inside ISPF.

Launch your 3270 client, log back into ISPF, navigate to =6 and run the following TSO command:

SCOREP1

When you see the message indicating you have successfully completed Part One, you are ready to move on to Part Two.

Reflect a moment on your experience thus far in the contest. You have successfully connected to and operated in two different environments on IBM's flagship operating system, z/OS; running on a state of the art, enterprise-class mainframe.

There are not many people in the world who can make this claim. It's quite the accomplishment, so well done! Consider putting participation in this contest on your résumé; hands-on mainframe experience distinguishes you from other job seekers and employers are always excited to meet young people who've learned something about the mainframe!

This is also a good time to brag to all your friends by posting a message to your social media networks.



For more background and information about mainframes and to see examples of how important the mainframe is, check out the following web sites:

You are now ready for the more difficult challenges in Part Two.

Thanks for participating, and good luck!

Next: Part Two - Challenge #01