Transferring files via FTP to z/OS seems to cause quite a bit of trouble with new Millennial Mainframers. This is partly because it’s not very intuitive sending and receiving files from the mainframe. Fortunately, there are a few ways to FTP.

One of the easiest ways is using IBM’s Personal Communications (or PCOMM). PCOMM is a 3270 terminal emulator, which is a client-side application that many mainframers use to communicate with the host. In some ways, PCOMM is a software implementation of the Ninjutsu (忍術) technique Hensōjutsu (変装術), which involved disguise, impersonation, and infiltration. From the perspective of the mainframe, z/OS thinks that it’s communicating with a traditional 3270 “green screen” terminal. However, in reality, the mainframe is really communicating with a Macbook Air or Microsoft Surface in disguise.

One of the great things about PCOMM is that is has FTP functionality built right into it. That’s right! PCOMM’s got additional Ninjutsu (忍術) powers!

In this case, PCOMM uses a host file-transfer program called IND$FILE to practice a technique of file transfer resembling Shurikenjutsu (手裏剣術). However, instead of throwing deadly weapons at the heart of your enemies, IND$FILE throws your choice of files into the heart of the z/OS filesystem!

If you’d like to learn more about the secretive art of IND$FILE, check out this great document from GSF Software.

For more general information about PCOMM, go here.

Send File to Host Example

Let’s go ahead and send a file to the mainframe. In this case, we’re going to send up a snapshot of the Earth taken by an Astronaut on the Apollo 17 mission. Since the System/360 mainframe was a key technology used by NASA to send men to the moon, this is pretty appropriate!

To follow along, grab this photo from Wikipedia here:

To start the transfer,  go to the “ISPF Command Shell” (Option 6 from the ISPF Primary Option Menu). Once on the panel, make sure that the cursor is on the beginning of the command line.

Then click on Actions -> Send File to Host…

This will open up Send Files to Host dialog.

Click on the ‘Browse…’ to select the Earth photo from your PC.

You’ll notice by default that the dialog automatically generates a Host File Name based on the file name appended with “bin” to signify that this is a binary file.  However, this will not work, as “The_Earth_seen_from_Apollo_17.jpgbin” does not follow z/OS dataset naming conventions.

According to convention, a z/OS dataset (file) is uniquely identified by a series of strings between one and eight characters, each separated by the dot (“.”) operator.  In the mainframe world, these names are each called “level qualifiers.” The leftmost or beginning string is called the dataset’s “high-level qualifier.” The subsequent middle strings are called “middle-level” qualifiers. The rightmost or last string is called the dataset’s “low-level qualifier”.

For example, in the z/OS dataset PAULY01.WORK.CLIBS:

  • PAULY01 is the High-Level Qualifier
  • WORK is a Middle-Level Qualifier
  • CLIBS is the Low-Level Qualifier
Oftentimes, the high-level qualifier is shared between numerous datasets to act as a form of organization similar to a directory.  The low-level qualified is often used to show the type of data stored in the dataset, similar to a file extension.

To correct this naming issue, rename the photo to ‘[USERID].EARTH,’ where USERID is your current z/OS user ID. I also make sure that “binary” is selected in the Transfer Type drop-down box, since with is binary file (.jpg) and not a text file.

It is critical to select “binary” because z/OS uses EBCDIC for character encoding, which is different from the ASCII scheme used by other platforms. Selecting “text” in the Transfer Type drop-down box causes the file to be translated between the two schemes to ensure the that text is readable by mainframe tools such as ISPF Editor. If you select this for your image, the binary data in the jpg photo of the Earth will become scrambled and unreadable.

Once the dialog is filled out, click “Update in List” to update the transfer file changes.

Finally, click “Send” to initiate the transfer.  The pop-up window will disappear when the transfer is complete.

Let’s check to make sure that our photo actually made it into z/OS. Go back to the “ISPF Primary Option Menu” and select option “3 Utilities” and “4 Dslist” to enter the DSList utility.  Once in DSList, enter [USERID].EARTH in the panel and hit execute. We now can see our file in z/OS.

We can go ahead an browse the dataset, but we’ll only see the JPG binary data associated with the Apollo 17 snapshot of Earth. Since z/OS doesn’t have a GUI like Windows, Linux, or Mac OS X, there is no direct way to view the photo directly.

FTP with Windows’ FTP.exe

Now that we’ve uploaded the binary data of “Earth.jpg” to z/OS dataset named [USERID].EARTH, let’s go ahead and download the file back to our PC using the Microsoft FTP Utility so that we can make sure that the picture is intact.
To do this, open up a DOS prompt (Start > Run > cmd) and enter ftp to start ftp.exe

Then enter the ftp command “open” followed by the IP address or DNS name of your mainframe.

If you don’t know this, then you’ll have to talk with your network admin to find out the IP or DNS name (or if it’s even activated).

In this example, we connected to host at “server.ca”

After connecting to the mainframe, enter your login userid (BBBBBPG) and password.

Notice that upon connecting, your “working directory” is set to BBBBBPG. This “working directory” is really the High-Level Qualifier of the datasets in the filesystem. Since a common z/OS convention is to set the high level qualifier of datasets to the USERID that owns the dataset, this is logical.

Similar to when we uploaded the photo, change the transfer type to “binary” by entering the FTP command ‘bin’

Finally, receive the file from the host by issuing ‘get earth’

Notice the message ‘Sending data set BBBBBPG.EARTH.’

At this point, the transfer is successful. The file is now on our local hard drive. However, the High-Level Qualifier of the file has been stripped off, so the file is called “earth” without a file extension.

To help your operating system understand that this file contains picture data, rename the file to add the “.jpg” file extension in the DOS prompt with the command “rename oldfile newfile.jpg”

Now, we can open the file and automatically using a photo viewer.  Success!  The entire Earth is there.

From coast to coast and continent to continent, you are now the Mainframe Ninja!

Paul Gamble
Graduate of Georgian College, Computer Programmer Analyst program

After doing a four month internship with the Canadian Government, Paul was offered the rare opportunity to work in their on-site Data Centre. Starting out as an Operator for four years before becoming a Systems Programmer rolling out different independent software vendors (ISVs) and different IBM Tivoli products for monitoring and automation to the z/OS platform. Paul enjoys the constant learning the z/OS operating system offers in comparison to other platforms. On weekends you’ll find Paul getting his adrenalin fix by instructing and coaching at the local skydiving drop-zone.
Connect with Paul on LinkedIn

z/OS Kung-fu Moves

#1 ISPF Combo moves 

By far the easiest way to master z/OS is to learn how to navigate and edit with ISPF really quickly, and the best way to bring swiftness to ISPF is through some choice combo moves.
Screenshot here of the ISPF Primary Option Menu.
I’m going to open up a dataset and play around to show some simple yet effective combo moves to get things done faster in ISPF.
To open a dataset for editing, enter one the following on the Option ===> prompt
           
            =3.4 or =3;4
These are shortcuts that concatenate the commands for going to the “3” Utilities and then the “4  Dslist panel.  This allows you to quickly navigate to DSList, which is one of the most powerful utilities in ISPF.

Once the “Data Set List Utility” is displayed, I can enter a Data Set name.  In this case, I’ve forgotten the exact Low-level Qualifier (LLQ) of my Data Set that I’d like to select. However, since I remember part of the dataset qualifiers, I can use wildcards “*” to help me out.  By entering BS9U.DEVT3.CLIB*, I can see all matching datasets.

Note: An LLQ is the last qualifier in a data set.  It’s the segment after the last “.”

This brings up a list of all the datasets that matched my dataset name parameters.  In this case, I see CLIBANDER, CLIBJAS, CLIBJAS3, CLIBPAU, CLIBRIC, CLIBSUT, and CLIBTOM

Hmm, it seems that I still can’t remember which of these data sets might contain the data I’m interested in, let alone the name of the particular member! 
Rather than thumbing through each data set, I decide to use a little-known command:
SRCHFOR [string]
This command invokes SuperC  [=3.12] to search for that string.  In this case I’m looking for the member that has the word “Coffee” in it.

The string is found in one of the data sets, in this case BS9U.DEVT3.CLIBPAU

Once I know the data set, there are two ways to find which member I want. 

Firstly, I can look in the output data set from SuperC, which is stored my default at userid.SRCHDSL.LIST


Secondly, I can simply  an “E” (for edit) next to the dataset, in this case BS9U.DEVT3.CLIBPAU, and issue SRCHFOR COFFEE again.  This time the search will be executed within the context of the data set, identifying the particular member I’m interested in.

It turns out that the member “TIMMIES” is the one I want.  (Here in Canada we drink a lot of Tim Horton’s coffee).

Now it’s time to edit this member, I place an “E” (edit) next to TIMMIES to edit this lovely member…a simple REXX program I wrote a few years ago available @ http://paulywill.com/mainframes/first_rexx_program

Since it’s been a few years since I’ve written this REXX EXEC, perhaps I’ve since given up coffee and switched to tea.  So naturally I’ll have to change every instance of “Coffee” to “Tea”.
First I want to see how many instances of the string “Coffee” are in this program using the find command:
F all coffee

Notice that the results are not case sensitive.
From the “ISPF Edit and Edit Macros ISPF Edit and Edit Macros” manual:

Once I’ve selected all of the strings I’d like to replace using using the FIND (or F) command, I can then change all the instances of “Coffee” to “Tea with the CHANGE (or C) command as follows:
C all Coffee Tea


Mmm… refreshing Canadian Tea.

Now that Tea Time is over, let’s add some more Kung-Fu

First, go ahead and change the strings back from tea to coffee using the following commands:

F all Tea
C all Tea Coffee

Now that we’re back to coffee, let’s assume I just want to display the lines with instances of  “coffee” and exclude all other lines of text in this member.

I could first use the EXCLUDE ALL (or X ALL) command to hide all of the lines of text:
xall

Then I could follow that with a find command for all lines with the String Coffee (here we specify ‘all’ to find all result):
fcoffee all

Then we can hide all of the ugly “Line(s) not Displayed” overlays by specifying:
            x hide

Let’s speed things up…

Let’s setup some of our keys so we’ll never have to enter those commands again.
Enter “Keys” at the command line to open up the “Keylist”.

If you scroll down (F8) you’ll notice it goes up to F24.  By pressing shift you can access this extra set of F keys for your own use.
For example you see that I have designated:
           
  • F21 (Shift + F9) has the SWAP command to switch between split screens (we can cover setting up split screens like a super star on another Kung-Fu Move) 
  • F22 (Shift + F10) has a reset command (RES) 
  • F23 (Shift + F11) has the commands we just entered EXCLUDE ALL; HIDE X; 
  • F24 (Shift + F12) has the CRETRIEV command which I use ALL THE TIME!!!  If the cursor is not on the command line it will place the cursor there; if I keeping hitting the key it will cycle through the last commands I entered,
Back to our example I could have:

  1. Opened the member with EDIT
  2. Excluded all the lines and hide exclude information with my F23 key (x all;hidex)
  3. Used the FIND command to find all the instances (f all coffee) 
  4. Made all the changes (C all Coffee Tea)
  5. Pressed F22 to reset the screen and see our changes 
  6. Saved changes with the SAVE command (my F4 key)
Boom!  All done.
Knowing some basic ISPF navigation, little known commands, and doing some basic KEY setup can speed things up.
For more Kung-Fu moves from others:
Google  “100 COOL MAINFRAME TIPS by Johnathan Jeban Martin”
Google “ISPF Hidden Treasures by Peter Van Dyke”

Flawless Victory!

Paul Gamble
Graduate of Georgian College, Computer Programmer Analyst program

After doing a four month internship with the Canadian Government, Paul was offered the rare opportunity to work in their on-site Data Centre. Starting out as an Operator for four years before becoming a Systems Programmer rolling out different independent software vendors (ISVs) and different IBM Tivoli products for monitoring and automation to the z/OS platform. Paul enjoys the constant learning the z/OS operating system offers in comparison to other platforms. On weekends you’ll find Paul getting his adrenalin fix by instructing and coaching at the local skydiving drop-zone.
Connect with Paul on LinkedIn
 

As one of the fairly new members into the mainframe family, I originally had some hiccups understanding the basics of mainframes. And by basics, I mean the absolute basics. I wish there was someone who could tell me a story of how it all happened from start to present in the mainframe world. A dear friend and a mainframe enthusiast suggested I read a book and the book clearly solved the purpose.Hence, here is a top ten list of the coolest z/OS facts.

1.      z/OS is an awesome multitasker


Back in the days, when z/OS was developed, computers were extremely expensive. Hence the developers built z/OS in such a way that different people could use z/OS to run multiple tasks at the same time. Every task that runs on z/OS runs in an address space and each task thinks that it’s the only one running. However, behind the screen, z/OS shares resources like memory and CPU across all tasks and there could be numerous tasks running at the same time sharing these resources.

2.      z/OS handles large workloads


It sounds quite obvious that z/OS can handle large workloads. But there must be a way to decide what tasks to run first and what can wait. In other words, how do we prioritize? z/OS uses a feature called WorkLoad Manager which helps in prioritizing system, production and non-production tasks. This helps z/OS in handling large workloads making 100% use of the CPU.

3.     It’s unbelievably hard to crash z/OS


Everyone expects z/OS to keep running and running and running. So anytime when a task crashes, we can not let that crash any other part of the system. Now remember we mentioned that every task runs in its own address space. So IBM has invested a lot of time and money in making sure that when a task crashes in one address space, it does not interfere with the normal functionality of the entire system, in other words making it robust and also clean up completely where the crash occurred so we can be up and running like new. But z/OS records any crash that occurs due to a hardware or software failure, so we can get into investigation later.

4.      z/OS has the best recording


z/OS comes with its own inbuilt scribe and we call it the System Management Facility(SMF). SMF records quite a lot of information like when was the system started, what task is currently running, when was a file created, when was it last edited, who deleted it, etc,. Security audits, capacity planning and performance monitoring are some of the uses of all this information that is recorded using SMF. IBM can proudly claim that z/OS has the most extensive recording of any operating systems.

5.     You need a job entry subsystem for z/OS


z/OS can run a series of jobs at the same time without any human intervention and they are called batch jobs. Users use a language called Job Control Language (JCL) to specify instructions for a specific job or a batch job to run. Once z/OS receives instructions from a user in the form of JCL, the role of a Job Entry Subsystem (JES) is to convert the JCL instructions into machine readable form and then queues them for processing, create address spaces, make sure all the input files for the job are ready, specify where the output has to be written and any other information required to run that job. Overall, JES acts like a manager, making sure, everyone has their resources to do their job and everyone does their job diligently.

  6.      How different are z/OS files?

                   We all know about files on windows. They store our data and we can access our files through an application like notepad. In z/OS, the concept of files is quite different. In the first place, they are not even called files. They are called Datasets. Each dataset is made up of records. When you create a new dataset, you need to specify the length of each record. Some other basic information that you need to specify are where the dataset should be stored and how big of a dataset it is. We will discuss about creating datasets and all the information you need to know to create a dataset in a later post. Hang in there!

               7.      How do you talk to the Mainframes?

 

How do we interact with such humongous mainframe computers and z/OS? We have to use an application called TSO/E( Time Sharing Option Extended) to talk to the z Systems. TSO/E is very hard to use. So z/OS comes with ISPF (Interactive System Productivity Facility). ISPF gives an interactive and easier way to communicate by providing lot of inbuilt functionalities

8.     You get UNIX with z/OS

When we say, you get UNIX with z/OS, that’s really an eye wash. What you really get is a POSIX compliant UNIX Shell called UNIX Systems services (USS). Posix compliant means that we meet all requirements to call it UNIX, but it’s actually not UNIX. 

9.      z/OS has a console

In your mainframe server room, you will have operators who would monitor your system on a regular basis to make sure if the system is running without any interruptions. The way they do it is, by monitoring the console with the system news feed to see what is going on in the system, if there are any alert messages or if there is any problem that they need to be aware of. The main z/OS console is directly plugged into the mainframe, so that even if there are network issues, the console will continue to work.

10.     z/OS isn’t enough

Once we successfully setup z/OS, we now have a basic operating system. But the real functionality of a mainframe is not exhibited unless we equip our system with applications that run on z/OS for security management, performance, database management, printing, etc,.  Apart from IBM, there are also other vendors in the market who sell applications that run on z/OS to make it more efficient.

If you need more of this, I suggest reading What On Earth is a Mainframe?
The book is a very easy read with topics ranging from fundamentals of mainframe hardware to application development on z/OS.
Posted in JCL.