MOM Pt. 001: Setting up my own Mainframe!

Hi!

It’s been two months since my last blog post, that’s bad! I took a break after participating in master the mainframe as it took a lot of time and energy away from me. I was not only active here on my blog but also on Slack and LinkedIn; I helped out a lot of students/enthusiasts with the challenges. But now… I’m back, alive and well.

So, I’m setting up my own mainframe today. I know I can still use the mainframe IBM has made publicly available to all Master the Mainframe contestants. But having my own mainframe is way more fun isn’t it? I can’t run z/OS as I would need a valid license.

I have two options:

  • VM/370 by IBM is the last public domain mainframe platform available.
  • MVS 3.8j Tur(n)key 4- System, no SQL available.

I will try MVS 3.8j. The only downside I really see with using one of these is that there’s no SQL-like driver available. The only good reason I have to use these systems is so I could develop COBOL and ASM directly inside a mainframe. It’s also a lot of fun!

I’ll definitely do some DB2 and COBOL later using IBM’s mainframe. I’m also unsure whether I’ll learn Java mixed with COBOL, that’s an option for the future.

So I was looking around on the internet and I stumbled upon a presentation by Jeroen Baten. He didn’t really explain how to setup a mainframe on Linux but he did give a clear statement.

https://media.ccc.de/v/vcfb18_-_96_-_en_-_201810141000_-_running_your_own_mainframe_on_linux_for_fun_and_profit_-_jeroen_baten

So, I’ll do exactly what Mr. Baten said.

Building Hercules from source

I’ll be doing this on Debian 9, as it is the operating system I’ll be running on Hetzner (a cloud host provider). There’s only 7 simple steps to follow.

  1. Download the source code to your system using wget: wget https://github.com/rbowler/spinhawk/archive/release-3.13.tar.gz
  2. Unzip using: tar xvzf release-3.13.tar.gz
  3. Run: ./util/bldlvlck and see which dependencies you need to install. Besides all listed dependencies you’ll also need to install g++ by issuing apt install g++. If you can’t execute the file then chmod u+x ./util/bldlvlck so you can execute the file.
  4. Then generate the configuration file using ./autogen.sh.
  5. Then configure using ./configure.
  6. Then create the executables using make.
  7. Then install the programs as root using make install.

This should be simple right? Right? Right… Also, the reason I’m getting the files from GitHub is because the autogen script is missing from the official download link. What’s up with that?! HUH?!

But… but… there’s also apt install hercules. I like building this from source. Just because.

So I have downloaded the files and extracted it to the spinhawk-release-3.13 folder. Now I can check which utils I still need to install.

I still lack autoconf, gawk, gcc, m4, make and g++. I’ll install those using apt install autoconf gawk gcc m4 make g++. When running the check util again it gives me OK for all requirements.

This means I can now generate a configuration file.

After generating the configuration file, I can let it configure by using ./configure and then I can make and make install. This might take a while.

Libraries have been installed in: /usr/local/lib/hercules. There! It’s done!

MVS 3.8j Tur(n)key 4-

This is easier than compiling Hercules. Actually, I don’t think setting up the Hercules emulator was necessary. I did it anyway. There’s also a Docker image available, but that’s not any fun either.

There’s only a few steps to do:

  1. wget http://wotho.ethz.ch/tk4-/tk4-_v1.00_current.zip
  2. wget http://wotho.ethz.ch/tk4-/tk4-cbt.zip (optional)
  3. wget http://wotho.ethz.ch/tk4-/tk4-source.zip (optional)
  4. unzip tk4-_v1.00_current.zip and then unzip the other zip files using the -o flag. Observe the screenshot below. It’s best to do this in a different folder.
  5. ./mvs

Getting the files.

Unzipping the files.

We’re going to set the MVS OS to console mode instead of daemon mode. This enables us to issue commands without being connected using a telnet connection. This can be done by changing to the unattended directory and running the  ./set_console_mode script.

Before we start the system, there’s a few things we need to know. Let me list it for you:

  • HERC01 is a fully authorized user with full access to the RAKF users and profiles
    tables. The logon password is CUL8TR.
  • HERC02 is a fully authorized user without access to the RAKF users and profiles
    tables. The logon password is CUL8TR.
  • HERC03 is a regular user. The logon password is PASS4U.
  • HERC04 is a regular user. The logon password is PASS4U.
  • IBMUSER is a fully authorized user without access to the RAKF users and profiles
    tables. The logon password is IBMPASS. This account is meant to be used for recovery purposes only
  • The IP address of the system. In this case I don’t need to port forward, it’ll also be a local IP address. You can discover the address by issuing ip addr show inside the terminal. Then you connect to that IP address using your 3270 terminal emulator. The port is 3270, not 23.

My address in this case is 192.168.0.156 and port 3270. I’ll start the mainframe OS using ./mvs.

MVS is up and running!

Connecting to my mainframe

I know, I know, I shouldn’t be using Vista TN3270. When I can, I’ll buy a copy. I’m still using the license from IBM’s Master the Mainframe challenge.

So I’m connecting to the IP above and I’ve set the IP Port to 3270.

Let’s connect!

It’s alive! Enter the LOGON command. I’ll login as HERC03 and my password is PASS4U.

Everything is now setup and I’m ready to start writing my own COBOL!

What about you?

Are you running your own mainframe? Do you want to? If you don’t like mainframes then let me know at idontlikemainframes at kevindurant.be. 

Let’s make our custom home screen in MOM part two!

Share this:

IBM MTM: Final Words

Hello again!

It’s been a month and a few days since I’ve spoken to you, my love. Have you missed me? On a more serious note, I felt that I could not start a new blog series without having closure. I’ve started this series of IBM’s Master the Mainframe 2018 contest on september 11th 2018 and now officially finished it 22nd of january 2019.

Here it is, the badge. W-o-o-o-o-o-o-o-h!

Thank you all!

I wish to thank all few thousands of visitors! Do you see that one last spike? That’s the last day the MTM contest was open, the 31st of december. A total of 440 visitors panicked and checked my website. We cried, laughed, had fun but we got all our work done. Each comment fueled my will to write blogposts and I would also like to thank all viagra and credit card loan spam bots to give me the illusion of 50 new comments per day!

Master the Mainframe 2019

Mr. Paul Newton told us that we’re going to work with Zowe’s open mainframe project. Get started at https://zowe.org/home/.

Zowe is a new open source software framework that provides solutions that allow development and
operations teams to securely, manage, control, script and develop on the Mainframe like any 
other cloud platform. Zowe is the first open source project based on z/OS.

I’m very curious about what they’ll come up with in 2019. In the meantime, it might be time to explore Zowe?

What am I going to learn next?

What about you?

What are you going to study? Did you get the badge?

Share this:

IBM MTM: Part Three – Challenge #15: MVP

Let’s finish the 2018 master the mainframe contest with a minimum viable product approach first. That’s what I’m going for boys and girls. Women and men. Children and babies. Dogs and cats. Insurance agents and real estate agents.

So, why MVP Kevin? Are you lazy?! No I’m not, I just don’t have much free time :'( And believe me, solving these challenges and writing a super duper blog takes time. Also this marks my 30st blogpost. Hoorah!

Is 30 a milestone? Hmm…

Step 1: the JCL

Use JCL to process system commands which writes the command output to 1 or more members in CH15.OUTPUT
  Example: CH15.JCL(S00JCL)

So first of all we need to write some information to one or more members in CH15.OUTPUT. This is easy, just a copy paste of CH15.JCL(S00JCL) with some minor alterations. These alterations are supposed to give our student some information about the IBM Z mainframe. I’ve reviewed S00JCL at my GitHub page.

This review can also be read together with my other reviews here. In this case IBM chose to display IPL information and to display several system configuration details. I’ll look for some interesting display commands, what would a student like to know about this mainframe? THE LIST IS SO LONG!

Maybe I’ll inform my student about how many services the current mainframe is offering. Then show how many users are connected and display their names ? Good gracious, I’m not creative at all. Think Kevin, think! Maybe display some system specs?

Before my students start dating my mainframe, they first need to get to know eachother.

Step 2: the Rexx

Write a Rexx routine to read the 1 or more members from CH15.OUTPUT, then write a report to P3.OUTPUT(#15)
  Example: CH15.SOURCE(S00#15)

Report written to P3.OUTPUT(#15) should include brief headings or statements helping to explain report details to reader
  Example: Your role is the experienced z/OS tech teaching a newbie (a judge) about the z/OS contest system

Report written to P3.OUTPUT(#15) needs to include a single line that informs reader/judges the name of the Rexx routine used to create the P3.OUTPUT(#15) report -
  Example: Report created by Rexx routine - ????? - where ????? could be R00#15 in CH15.SOURCE

This is the difficult part of the challenge. We need to use the output that our JCL generated, create a report from it, add a script identifier to that report and write it to P3.OUTPUT(#15). To code this Rexx I’ll need to know what my output looks like by heart. I’ll need to master the output. See what I did there? Heheh.

So… CH15.SOURCE(S00#15) is what we’re going to be using as a guideline. S00#15 is a compilation of all SAMPX Rexx scripts. I need to understand all other SAMPX Rexx scripts or I won’t be able to throw a script together. But first, let me create a plan of action.

  1. Run my JCL and take notes of all interesting information and identifiers that point me to that information.
  2. Create a Rexx routine that says all of that information and debug until I get the output I want.
  3. Implement the saving into P3.OUTPUT(#15).

The first thing I did way say everything so I had a way of debugging what I wanted to do. My goal is to just say some system details, say what was going at initial program load time and say who was running a job.

This is what I’ve got. It doesn’t look like much but it’s actually more code than S00#15.rexx. I’m not sure if this is enough to finish part 3. This doesn’t meet their minimum requirements yet.

1
2
3
4
5
6
7
8
9
10
11
SELECT
    WHEN w1 = 'JOBS' & w2 = 'M/S' THEN
    DO
        Details_position = i + 1
        parse var rpt.Details_position w1 w2 w3 w4 w5 w6 w7
        Max_users = STRIP(SUBSTR(w6,POS('/',w6)+1),'L',0)
        say 'Amount of jobs processed at that time:' STRIP(w1,,0)
        say 'Amount of users online at that time:' STRIP(w3,,0)
        say 'Amount of maximum users allowed on this machine:' Max_users
    END
    OTHERWISE ITERATE

Instead of saying the lines I need to print them to Z30163.CH15.OUTPUT(#15). What IBM does in S00#15 is first open the output and when all code is ran calls write_output. They write their variable called o to the file they need. So from what I understand is that I need to open my output file, replace all say to o.index and write it to the file. Not as easy as it sounds I’m afraid? Let’s first take a backup and get on with it.

By the way did I tell you?

Press the ATTN (escape) or PA1 key to terminate script execution.

1
2
3
4
5
6
7
8
9
10
Fe = ''
    do i=1 to rpt.0
        parse var rpt.i w1 w2 w3 w4 w5 w6 w7
        select
        when w2 = 'IBM' & w3 = 'CORP' & POS(".",w6) = 0 then Fe = Fe w5 w6','
        when w2 = 'IBM' & w3 = 'CORP' & POS(".",w6) > 0 then Fe = Fe w5','
        otherwise iterate
    end
end
o.10 = STRIP(Fe)

So this is a good example of where I changed my says to assigning the value to the index at o. After changing all my say code I can finally copy past the open_output and write_output function and call them at the right time. Let’s see if everything prints out ok.

Looks okay! Some of my strings are longer than 80 characters. I might need to fix that, but this is the minimum viable product. I wrote a Rexx routine that reads data from CH15.OUTPUT that was generated by a custom CH15.JCL and eventually generates a small motivational report to P3.OUTPUT(#15).

I really liked doing this, it’s sad this Mainframe blog will come to an end soon.  But hey, let us at least hope I’ve scored some points 🙂

Have you scored lately?

Share this: