IBM MTM: Part Three – Challenge #03

Hi there!

I feel like I’m progressing really fast, that’s good! I’m also very motivated because I’m expecting to get my IBM Digital Badge soon! I want the Part 3 badge really bad so I’ll do my best to solve all of its challenges. However, I guess the blog posts will slow down as the challenges get harder.

I’m lacking in humor lately, I don’t know why that is. You guys know of any good comedy movies? I need some sources of inspiration.

Also quick note, you’re now able to unsubscribe via the e-mail you receive. All your data gets removed. Good!

Sort Utility Capabilities Continued

IBM Master the Mainframe Part Three – Challenge #03

Today we got data from another company and we need to validate the data because we can’t trust that the data records are valid from the get go. I need to make another report on the data validity of the account limit and balance fields. Let’s check the data set first.

Mr. Peabody told me the SORT utility can perform a validity check on packed decimal data fields. He also asked me to observe the Account Limit packed decimal field that starts in position 9 for a length of 5 and the Account Balance packed decimal field that starts in position 14 for a length of 5.

I’m told I should use the more advanced features of SORT and ICETOOL with logical expressions. Let’s not go too deep into the theorem right now, I’ll check out the challenge assignment first.

First let’s edit Z30163.JCL and make a new member called sort003. Then copy ‘zos.public.toolbag(sort003)’ into Z30163.JCL(sort003). Same way we did last time, using the COPY primary command.

This is what I have now. Now modify the JCL job reference to ZOS.PUBLIC.BBRI.CLIENTS. Next up is to modify the ICETOOL control statement replacing both P,M,F. One for each packed decimal field with the appropriate starting position P, length M and data format F for Account Limit and Account balance.

We need to get our P,M,F from the table above. They said for each packed decimal position, we have those don’t we? Let’s just take a look at the formats and adjust the ON(P,M,F) fields.

Let’s submit and review our output, it should throw Max-RC with CC 00012.


Yup! Got the MAXCC=0012! Now let’s the system for all the information available of JOB06280 and check OUTDD. “If the Account Limit or Account Balance fields have a string of asterisks, then a bad packed decimal field was detected.”

You see those two rows of asterisks? Holy cow, asterisks is a difficult word to spell. All is ok! Now let’s check TOOLMSG and check the report. It should report invalid HEX VALUE.

Yup it reports two invalid HEX VALUES. Mr. Peabody explains knowing the specific invalid hex values found in Account Limit and Account Balance field is needed because while the business analyst or auditor did not request the specific hex values, once you find invalid hex values, they may ask you for the specific hex value to help determine the correct amount.

Let’s create the rapport for the analysts. Again, I’ll create a new JCL member called sort004COPY ‘zos.public.toolbag(sort004)’ into it and modify the JCL its client master file input.

Those are a lot of parameters! WOW! Again, I’ll change the SETVAR and modify the control statements P,M,F for each packed decimal field.

  • GOOD records uses EQ comparison operator and the AND operation for checking both Account Limit and Balance
  • BAD records uses NE comparison operator and OR operation for checking both Account Limit and Balance

So what do we actually have to change here? I guess just the PMF for both packed decimals. Actually when you look at the statements it’s pretty easy! ‘INCLUDE=(P,M,F,EQ,NUM,AND,P,M,F,EQ,NUM)’ Include everything from starting position P for a length of M that has the format F and it should EQUAL type NUM AND same thing for everything from starting position P for a length of M that has the format F and it should EQUAL type NUM.

I guess it’s just copy paste the same P,M,F from last JCL. I though we needed the position of that specific record? It doesn’t feel right to just write the same PMF as last time. I’d really like to understand what I’m doing.



There’s no BAD output I can xdc to Z30163.P3.OUTPUT(#03). Or do I literally have to check P3.OUTPUT and see if it’s there? Let’s have a look!

Yup it’s here! As I said earlier, I don’t really fully understand what I’m doing. I don’t think I can write my own ICETOOL script just yet. I might do this challenge again.

Mr. Peabody told me that another challenge is anticipated where the SORT utility and companion ICETOOL utility is the best way to complete the assignment. Next challenge is about COBOL though! Finally!

I probably won’t write my own COBOL just yet, but I’ll atleast get to smell it. Challenge #04 looks pretty easy, yay 🙂


COBOL looks really cool! I’m genuinly interested in the language. I might buy Murach’s Mainframe COBOL whenever I setup my own mainframe emulator using Hercules-390 and some open-source operating system like the MVS 3.8J Operating System.

Also… I wrote this blog after a long day at work, let the hunt for spelling mistakes begin!

On a different note, what are you genuinly interested in?

Share this:

IBM MTM: Part Three – Challenge #01-02

We’re at #01 again. It feels like I just started all over again. Anyways, these challenges will be a lot more challenging. Less handholding and a lot more work! As promised to Paul Newton from IBM I won’t be posting the solutions to these challenges. I’ll just write about my experiences running through these challenges.

I know, this possibly makes it a lot less interesting to read for you guys but I’m sure some posts will be of great help when you’re doing the challenges yourself.

I’ve also changed the way you can comment, now you don’t need to enter a name or mail address.

Getting Started

IBM Master the Mainframe Part Three – Challenge #01

Well I think it can’t hurt showing the solution to challenge #01 as there’s really not much to do.

Run tso part3. Then edit Z30163.P3.OUTPUT(#01).

This was the output, now I need to copy the lines from P2.OUTPUT(#01). That can be done using the COPY primary command. For some reason typing copy p2.output(#01) after a didn’t work, even when I wrote a on line 000001. I’m not sure what I’m doing wrong. I just used the copy tool using its ‘wizard’. I think the quick command for the copy utility is =3.3.
Deleting the line is easy, I wrote about this before. You can use the dd line command. This leaves me with only Belgium present inside the list.
This is it for the first part!

SORT Utility Capabilities

IBM Master the Mainframe Part Three – Challenge #02

This time I’m responsible for validating another company their client master file. I’m doing this with the help of Mister Peabody, a senior technician.

My company AA Global Investments periodically acquires smaller regional investment companies. This time we’re negotiating acquisition of BB Regional Investments. The acquisition includes about 45 million clients. We need to validate BBRI client records.

Let’s first study the Master File Client Record Layout.

The Unique Account Number can be used to identify duplicate records. But please note that a client may have multiple account numbers and duplicate account numbers may happen. Duplicate account numbers are not done, so we’ll need to handle that.

I’ll edit Z30163.jcl and make a new member called sort001. Primary command s sort001 does the trick, I had to use this in Part 2 once.

Now we need to copy ‘zos.public.toolbag(sort001)’ into z30163.jcl(sort001).

This got me the following JCL.

A simple modification needs to be made. The SET operation needs to reference ZOS.PUBLIC.BBRI.CLIENTS as the SORTIN data set name. JOB08137 completed! If message ICE055I is in SYSOUT then any records with duplicate unique account numbers were found and deleted. Let’s check.

Yup! A total of 4 records were deleted. I told Mr. Peabody that I’ve deleted 4 duplicate records. However he now wants a special report about the duplicate records.

The analysts want a list of client records containing duplicate unique client account numbers and a list of client records without the duplicate account numbers. Mr. Peabody told me about a tool called ICETOOL, let’s see how it can help me.

I’ll go ahead and make a new JCL member called sort002 and copy ZOS.PUBLIC.TOOLBAG(sort002) into it.

Got it! Again, change the SETVAR to ZOS.PUBLIC.BBRI.CLIENTS. Now I need to modify ICETOOL its select control statement directives. At line 9 it says ON(P,M,F) where P,M,F stand for starting position (P), length (M), and field format (F).

First I need to get the unique account number values for P,M and F from the JCL job SORT001. Luckily I have a screenshot not far above. However, splitscreen using F2 is nice to know though!

JOB08379 submitted! The report was written to Z30163.P3.OUTPUT(#02). Let’s check and then give it to Mr. Peabody.

Output looks good! What! Mr. Peabody said that this isn’t exactly what the business analysts requested? I need to adjust the ICETOOL select control statement directive to the correct report. I’ve been told to change LASTDUP. Time to read some documentation and hope everything is ok.

If found the directive needed to write all the duplicate records into the duplicate report. JOB08420 submitted!

Looks like I found all duplicates! Why did I only find four last time? Huh… wait a minute! Let’s check P3.OUTPUT(#02).

Seems more like it! It guess that’s it for today huh?

Bad news

I’ve completed part 2, but it appears that I don’t deserve a place on the wall of fame because I’m officially not a student. I don’t really see the point of not including other enthousiasts on this list, but hey who am I?

However, I just received this in my inbox:

I was afraid that I wasn’t eligible for the badges as I’m just participating in the learning course, not in the contest. But this e-mail gives me good hope!


Hi anonymous readers! I see a lot of traffic but probably nobody likes to comment. I understand! I’ve added this applause button next to the post title, click it! It’ll make someone smile! Also, you can comment anonymously now!

What made you smile lately?

Share this:

IBM MTM: Part Two – Challenge #15

I’m at the milestone! I’m at the last part two challenge. This is a challenge that requires me to dig up all my previously acquired mainframe knowledge to solve this challenge. I need to navigate 4 different types of data sources, find a number that’s encoded in one of three encoding types and calculate the sum of those numbers.

At first I thought I needed to write code that would access each data source and get that number but I just need to physically read it and write it down on a notepad or something.

Number Hunt

IBM Master the Mainframe Part Two – Challenge #15

The 4 data sources include:

  1. Sequential Data Set Name
  2. Partitioned Data Set Member Name
  3. Unix File Name
  4. DB2 Table

Each number may be in 1 of 3 formats:

  2. ASCII
  3. Packed Decimal

So now you know. I won’t be given the data format in which the data is in. I’ll have to figure it out myself when I see it. I’ll post screenshots of my progression but I’ll blur my solutions. Sorry for that! Just remember, if I can do it… you can too!

I need to sum the 8 numbers found in the specified record and column positions from the following data sources:

Data Set Name Z#####.HUNT1
  #1 Record 14 Column 35 to 38
  #2 Record 18 Column 78 to 80

Data Set Name Z#####.HUNT2 Member Name FRED
  #3 Record 7 Column 1 to 3
  #4 Record 9 Column 47 to 49

Unix File Name /z/z#####/dennis
  #5 Record 6 Column 42 to 45
  #6 Record 11 Column 31 to 33

  #7 Column PHONENO where lastname is YAMAMOTO
  #8 Column BONUS where lastname is YAMAMOTO

Then I need replace 0000 on the last line in Z#####.JCL(P2DONE) and execute it.


Record 14 Column 35 to 38 and Record 18 column 78 to 80 contain a number. The number at record 14 is invisible? Let’s put hex on as we did in Challenge #08. Now we can see EBCDIC characters.


These characters have to be decoded to a number.

If I’m right, those characters appear to be ASCII character bytes. These are really easy to decode. Now on to the next line, these numbers are not visible. They are more to the right. Could’ve guessed, they’re in a different format.

I have the numbers, do you?


Inside member name FRED we need to find numbers at Record 7 Column 1 to 3 and Record 9 column 47 to 49. All data should be visible without shifting.

Observe the red marks. I’m not sure what Record 9 Column 47 to 49 is supposed to be. But Record 7 is easy, same as previous hunt.

I found out what Record 9 was, it’s a tricky one. Goodluck!


Remember Challenge #13? This is basically the same. Remember, lowercase!

Again everything should be visible. Now just hex on and let’s decode some characters! The first one at column 6 is easy. Column 11 is also easy, nothing we haven’t seen yet!


Let’s exit ovms and write some SQL. Again some DB2 interaction, finally! Same as Challenge #14.

I wrote the select where statement and got this result. Sorry for the censor! Now I have all the numbers 🙂


This was fun and challenging. Let’s edit JCL(P2DONE) and fill in the numbers!


Successful completion of P2DONE writes the answer to P2.OUTPUT(#15) and deletes data sources.

The data sets are gone! I got the number right!

Completing Part 2

I’m really curious, did I make any mistakes? Did I delete someone else’s database? Did I crash IBM’s server with my select * query? Let’s run TSO SCOREP2 and see how I did!

Oh my god! Let’s check STATUS!

YES!! I am now officially a part 2 finisher!

I’ve gained experience in:

  • TN3270 Emulator
  • TSO, Time Sharing Option
  • ISPF, Interactive Productivity Facility
  • ISPF Editor
  • SDSF, System Display and Search Facility
  • Hexadecimal, EBCDIC, ASCII, and Packed Decimal
  • JCL, Job Control Language
  • Sequential and Partitioned Data Sets
  • VSAM Data Sets
  • IDCAMS Utility Program
  • Unix System Services and Unix Files
  • DB2 SQL

What a list I say!

Part 3

We need to have a chat about Part 3. I was told that I can’t publish part 3 solutions. And I won’t. I’ll try to write interesting blogs about my route through part 3, post some snippets but stay vague enough that you’d still have to do the hard work if you’re participating in IBM’s MTM challenge.

I’d like to thank everyone for checking out out my blog this far. I’ve been blogging for about a month and it’s been keeping me motivated for just about everything. I quit programming after work before I was doing the MTM challenge. Now I’m all up and running again, staying healthy and motivated.

What’s been keeping you running, healthy and motivated?

Share this: